Hi all.
I need to transfer Win32 made controls and dialogs to InstallScript.
I found that the only way to do it is to use the DefineDialog with DLG_MSG_ALL.
But in this case WaitOnDialog still filters all "unnecessary" messages.
The following IS code is stuck after GetMessage function:
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Organize message loop without WaitOnDialog
Started by
mirik222
, Sep 09 2010 19:10
1 reply to this topic
Posted 09 September 2010 - 19:10
CODE |
DefineDialog (szDialog, NULL, "",DIALOG_ID, "", NULL, HWND_INSTALL, DLG_MSG_ALL|DLG_CENTERED); hwndDlg = FindWindow("","installshield wizard"); ShowWindow(hwndDlg,SW_SHOW); UpdateWindow(hwndDlg); GetMessage(&msg,NULL,0,0); |
What am I doing wrong?
Edited by mirik222, 10 September 2010 - 20:38.
Posted 16 October 2010 - 17:08
The problem was in catching custom control messages and is partly solved.
The dialog should be created by DefineDialog instead of the standard EzDefineDialog.
The dialog should be created by DefineDialog instead of the standard EzDefineDialog.
CODE |
if(DefineDialog( szDlg, 0, "", SD_NDLG_WELCOME,"",0,HWND_INSTALL,DLG_MSG_ALL|DLG_CENTERED ) = DLG_ERR) then return -1; endif; |
Then, the events are caught by the regular way, with switch/case block:
CODE |
case 1301: ret = SendMessage(hListWnd, LVM_GETNEXTITEM, -1, LVIS_SELECTED); if(ret > -1) then lvit.mask = LVIF_TEXT; lvit.iItem = ret; lvit.iSubItem = 0; lvit.pszText = &szListText; lvit.cchTextMax = MAX_PATH; SendMessage(hListWnd, LVM_GETITEMTEXT, ret, &lvit); pstr = lvit.pszText; szItemName = pstr->str; endif; |
PSTR structure is defined for pointer resolution. I didn't find how to do it in InstallScript.
CODE |
typedef PSTR begin string str[MAX_PATH]; end; |
Edited by mirik222, 16 October 2010 - 17:11.