Hi,
I have one Software that make for that API in dll format.
When run software API open one Dialog and ask for "Username" & "Password".
Problem is when I start software instead it show dialog front of software screen, shows on Toolbars and subwindow of software.
For create dialog I using CreateDialogParam function.
Use below code to create Dialog:
hDlg = CreateDialogParamA(g_hInstance, MAKEINTRESOURCE(IDD_DIALOG1 ), hWnd, DialogFunc, 0);
For hWnd I using value that software send to dll.
INT_PTR CALLBACK DialogFunc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HMENU hMenu;
switch(uMsg)
{
case WM_INITDIALOG:
read(f1);
read1(f2);
hDlg1=GetDlgItem(hDlg,IDC_EDIT1);
SetWindowTextA(hDlg1,UserSaved);
hDlg2=GetDlgItem(hDlg,IDC_EDIT2);
SetWindowTextA(hDlg2,PWDSaved);
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_BUTTON2:
char buff1[1024];
char buff2[1024];
char buff3[1024];
hDlg3=hDlg;
GetWindowText(hDlg1,username,1024);
write(f1);
GetWindowText(hDlg2,key,1024);
write1(f2);
if(memcmp(Get_Account_Number_FromWEB(),b1,sizeof(b1))==0 ){result=1; DestroyWindow(hDlg);}
else MessageBox(0,TEXT("Wrong User or PWD"),0,0);
break;
case IDC_BUTTON3:
DestroyWindow(hDlg);
break;
case IDC_EDIT1:
break;
case IDC_EDIT2:
break;
}
break;
case WM_CLOSE:
SetWindowLongA(hDlg, GWL_WNDPROC, dwNewLong);
DestroyWindow(hDlg);
return TRUE;
break;
}
return FALSE;
}
How to set this Dialog shows in front of software screen and not side of screen?
Regards,