Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Createthread in x64

Featured Replies

Posted

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

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);
  • 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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.