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.

identifiying/keeping appart multiple instances of dialog boxes

Featured Replies

Posted

hi,

so i have been messing with native GUI programming in msvs2008 recently and lots and lots of problems & questions arose... :)

Most of them were exterminated by a quick google search. :)

This one is a little persistent, though:

I have a class, myclass. The user can create multiple instances of that class.

Every class instance has its own instance of a dialog box, which can be displayed at the same time.

How can i now link a class instance to a dialog box?

ie, if the dialog boxes CALLBACK routine is called, how can i know which class instances dialog box send the message?

deep0 :)

I don't think I've understood your problem well, but what if you associate a value with each dialogbox handle using SetWindowLong and DWL_USER as parameter after the creation of the dialogbox :

I think of something like (as I don't know your C++ class implementation):

HWND myclass::Create(..){
...
this->hwnd = CreateDialogParam(...);
...
}
void myclass::SetID(DWORD id){
...
SetWindowLong(this->hwnd, DWL_USER, id);
...
}
myclass *mc = new myclass(...);
assert(myclass);
mc->SetID(0xFEADBEEF);...myclass *mc2 = new myclass(...);
assert(myclass);
mc2->SetID(0xFEEDBAAC);

and in the callback function, you can use a switch/case to test against the already known IDs after calling

GetWindowLong(GWL_ID)

Edited by Zool@nder

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.