This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Using Win32 Controls and Message loops in IS
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 07, 2010
04:11 AM
Using Win32 Controls and Message loops in IS
Hi all.
I try to overcome IS limitations regarding dialog messages and custom controls and I stucked at the very beginning.
The dialog is not created.
May be somebody has positive experience in this area?
Used EzDefineDialog with external DLL?
Created custom controls in IS?
Defined dialogs and processed message loop in Win32/C style?
Defined function pointers in IS?
I try to overcome IS limitations regarding dialog messages and custom controls and I stucked at the very beginning.
prototype HWND User32.CreateDialogParamA(POINTER,LPSTR,HWND,POINTER,NUMBER);
prototype BOOL User32.GetMessage(MSG POINTER,HWND,NUMBER,NUMBER);
MSG msg;
STRING szDlgID = "12006";
LPSTR lpstrDlgID = &szDlgID;
HWND hwndDlg;
hwndDlg= CreateDialogParamA(NULL, lpstrDlgID, NULL, NULL, 0);
if(!IsWindow(hwndButton)) then
return FALSE;
endif;
ShowWindow(hwndDlg,SW_SHOW);
UpdateWindow();
while (!bDone)
//GetMessage(&msg,NULL,0,0);
PeekMessageA(&msg,NULL,0,0,PM_REMOVE|PM_NOYIELD);
...
endwhile;
The dialog is not created.
May be somebody has positive experience in this area?
Used EzDefineDialog with external DLL?
Created custom controls in IS?
Defined dialogs and processed message loop in Win32/C style?
Defined function pointers in IS?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 09, 2010
12:35 PM
I found out that it can be achieved by DefineDialog + DLG_MSG_ALL.
It supposed to pass all windows messages but the problem is that WaitOnDialog still filters all non "OnClick" messages.
I was able to see only WM_LBUTTONDOWN.
It supposed to pass all windows messages but the problem is that WaitOnDialog still filters all non "OnClick" messages.
I was able to see only WM_LBUTTONDOWN.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 03, 2010
01:28 AM
Hi all.
After long time of R&D I reached this point in my fight with InstallShield monster:
This code is for testdll.dll with windows message loop:
My goal is to catch all windows messages in IS message loop.
Right now, for example, for ListView it can catch some of the ListView messages when that control is focused (mouse is over it).
The above code works on C++ but doesn't work on IS.
Does someone have any clue?
After long time of R&D I reached this point in my fight with InstallShield monster:
szDllName = "C:\\Visual Studio 2008 Projects\\testdll\\Debug\\testdll.dll";
UseDLL(szDllName);
hMod = GetModuleHandle(szDllName);
if(hMod = NULL) then
MessageBox("hMod",MB_OK);
abort;
endif;
hFunc = GetProcAddress(hMod,"DlgProc");
if(hFunc = NULL) then
MessageBox("hFunc",MB_OK);
abort;
endif;
if(DefineDialog( szDlg, 0, "", SD_NDLG_WELCOME,"",0,HWND_INSTALL,DLG_MSG_ALL|DLG_CENTERED ) = DLG_ERR) then
return -1;
endif;
hwndDlg = FindWindow("","dialog - InstallShield Wizard");
if(hwndDlg = NULL) then
MessageBox("hwndDlg = NULL",MB_OK);
abort;
endif;
vRes = SetWindowLong(hwndDlg,DWL_DLGPROC,hFunc);
if(vRes = 0) then
MessageBox("vRes = 0",MB_OK);
abort;
endif;
ShowWindow(hwndDlg, SW_SHOW);
UpdateWindow(hwndDlg);
vRes = GetMessage(&msg, NULL, 0, 0);
while (vRes != 0)
if (vRes == -1) then
MessageBox("GetMessage=-1",MB_OK);
elseif (!IsWindow(hwndDlg) || !IsDialogMessage(hwndDlg, &msg)) then
TranslateMessage(&msg);
DispatchMessage(&msg);
endif;
vRes = GetMessage(&msg, NULL, 0, 0);
endwhile;
FreeLibrary(hMod);
This code is for testdll.dll with windows message loop:
extern "C" __declspec(dllexport) INT_PTR DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
switch (message)
{
case WM_INITDIALOG:
OutputDebugString(L"WM_INITDIALOG");
return (INT_PTR)TRUE;
case WM_COMMAND:
OutputDebugString(L"WM_COMMAND");
if (LOWORD(wParam) == 9 || LOWORD(wParam) == 1)
{
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;
}
return (INT_PTR)FALSE;
}
My goal is to catch all windows messages in IS message loop.
Right now, for example, for ListView it can catch some of the ListView messages when that control is focused (mouse is over it).
The above code works on C++ but doesn't work on IS.
Does someone have any clue?
