Posted September 14, 20213 yr Hi all I'm trying to compile simple c program with animated title bar (swapping letter case) but unfortunately I'm stuck with CreateThread in x64. Here is my sample code: DWORD WINAPI animate(HWND hWnd); HANDLE hthread; case WM_INITDIALOG: SendMessageA(hWnd, WM_SETICON, (WPARAM) 1, (LPARAM) LoadIconA(hInst, MAKEINTRESOURCE(IDI_ICON))); hthread = CreateThread(0, 0, animate, hWnd, 0, 0); DWORD WINAPI animate(HWND hWnd) { unsigned char wincaption[24]; unsigned int i; SendMessageA(hWnd, WM_GETTEXT, 24, (LPARAM)wincaption); do { for(i=0;i<19;i++) { if (((wincaption[i] >= 0x41) && (wincaption[i] <= 0x5A)) || ((wincaption[i] >= 0x61) && (wincaption[i] <= 0x7A))) wincaption[i] ^= 0x20; SendMessageA(hWnd, WM_SETTEXT, 0, (LPARAM)wincaption); Sleep(500); } } while (1); return 0; } Full package attached. It compiles to "mov r8, qword ptr [animate]" instead of "mov r8, offset animate". If compiled to x32 everything is fine. Can someone point me my error. Thanks in advance test.zip
September 14, 20213 yr It probably depends on which compiler & what settings you use. My VS2019 builds your code perfectly for both x86 and x64. If your compiler keeps being stupid, try using this: hthread = CreateThread(0, 0, &animate, hWnd, 0, 0);
September 15, 20213 yr Author Thanks. Tried that also and don't work. Compiles the same way. Will change compiler (using old LCC) to VS community (at least free version).
Create an account or sign in to comment