Dialogs from a DLL
Posted: Fri Jan 27, 2006 6:19 am
I have a ton of these and for the life of me I can't seem to find a way to access them. I can load bitmaps and icons. There's a CreateDialogParam_ macro for PB so why wouldn't this work? This is driving me crazy.
I've tested with several dlls, but the following code uses cmdial32.dll
Declare Callback(WindowID, Message, wParam, lParam)
hwndMain = OpenWindow(#PB_Any, 100, 100, 480, 480, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "MainWindow")
Debug(hwndMain)
hlib = OpenLibrary(#PB_Any, "cmdial32.dll")
hndModule = GetModuleHandle_("cmdial32.dll")
hndDialog = CreateDialogParam_(hndModule, "#101", hwndMain, @Callback(), 1)
hndResource = LoadResource_(hndModule, "#101")
hndIcon = LoadIcon_(hndModule, "#112")
hndBitmap = LoadBitmap_(hndModule, "#113")
Debug(hlib)
Debug(hndModule)
Debug(@Callback())
Debug(hndResource)
Debug(hndDialog)
Debug(hndIcon)
Debug(hndBitmap)
success = CloseLibrary(hlib)
Debug(success)
Delay(1000)
Procedure Callback(WindowID, Message, wParam, lParam)
Debug(lParam)
ProcedureReturn DefWindowProc_(WindowID, Message, wParam, lParam)
EndProcedure
Any ideas?
Thanks in advance.
Jon
I've tested with several dlls, but the following code uses cmdial32.dll
Declare Callback(WindowID, Message, wParam, lParam)
hwndMain = OpenWindow(#PB_Any, 100, 100, 480, 480, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "MainWindow")
Debug(hwndMain)
hlib = OpenLibrary(#PB_Any, "cmdial32.dll")
hndModule = GetModuleHandle_("cmdial32.dll")
hndDialog = CreateDialogParam_(hndModule, "#101", hwndMain, @Callback(), 1)
hndResource = LoadResource_(hndModule, "#101")
hndIcon = LoadIcon_(hndModule, "#112")
hndBitmap = LoadBitmap_(hndModule, "#113")
Debug(hlib)
Debug(hndModule)
Debug(@Callback())
Debug(hndResource)
Debug(hndDialog)
Debug(hndIcon)
Debug(hndBitmap)
success = CloseLibrary(hlib)
Debug(success)
Delay(1000)
Procedure Callback(WindowID, Message, wParam, lParam)
Debug(lParam)
ProcedureReturn DefWindowProc_(WindowID, Message, wParam, lParam)
EndProcedure
Any ideas?
Thanks in advance.
Jon