How can i create Window in plug in.
i can not find HINSTANCE of Application, which is required to register Window Class.
Or is there any other methods to create Window.
Thanx in advance
D.G. JAdeja
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Don is right, the hModule is synonymous for the hInstance handle, but instead of using CreateWindow(Ex), I have found that using CreateDialog(Ex) is convenient also. Especially when you're making little pop-up input/output windows.
I usually put a statement like this in a resource file
IDD_DLGEXAMPLE DIALOG 10, 10, 400, 200
STYLE WS_POPUP | WS_BORDER
CAPTION "Example!"
{
Hi,
How can i create Window in plug in.
i can not find HINSTANCE of Application, which is required to register Window Class.
Or is there any other methods to create Window.
Thanx in advance
D.G. JAdeja
in Dllmain :
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD reasonForCall,
LPVOID lpReserved )
hModule is your hInstance.
Just cast in HINSTANCE before using it.
Don
Hey D.G. JAdeja,
Don is right, the hModule is synonymous for the hInstance handle, but instead of using CreateWindow(Ex), I have found that using CreateDialog(Ex) is convenient also. Especially when you're making little pop-up input/output windows.
I usually put a statement like this in a resource file
IDD_DLGEXAMPLE DIALOG 10, 10, 400, 200
STYLE WS_POPUP | WS_BORDER
CAPTION "Example!"
{
LTEXT "Name:", IDC_LBLSTATIC, 10, 10, 50, 10
EDITTEXT IDC_TXTNAME, 60, 10, 100, 10, ES_AUTOHSCROLL
}
and then instantiate it with
DialogBox( hModule, MAKEINTRESOURCE( IDD_DLGEXAMPLE ), nppData._nppHandle, (DLGPROC)DlgExampleProc );
Cordially,
John
Woops...I meant DialogBox(Ex), and not CreateDialog(Ex).
Cordially,
John