NO

Author Topic: Problem to minimize Window  (Read 2001 times)

pitter2206

  • Guest
Problem to minimize Window
« on: April 17, 2010, 12:37:58 PM »
Hi guys,

to solve a vendors-bug, I have to start an application later.

Therefore I have to delete the start out of the LUA:

Code: [Select]
if (registry:openKey( eRegKey_HKLM, "\GoPal") == true) and (registry:readStringValue( "BtStatus") == "1" ) then
   shell:Execute( "shortcut://dialer", "/m" );
end

My C-file is like that:

Code: [Select]
#include <windows.h>
#include <windowsx.h>

HKEY hkey;

int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpszCmdLine, int nCmdShow)
{
CreateProcess(L"\\My Flash Disk\\Navigation\\mnavdce.exe\0",NULL,0,0,FALSE,0, 0, 0, NULL, NULL); // Navigation starten
Sleep(10000);

DWORD dwData = 256;
BYTE cDaten[256];

if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"GoPal", 0, KEY_READ, &hkey) == ERROR_SUCCESS)
{
if (RegQueryValueEx(hkey, L"BTStatus",0,0,cDaten,&dwData) == ERROR_SUCCESS)
{
if (cDaten[0] == '1')
{
if (CreateProcess(L"\\My Flash Disk\\Bluetooth\\PhoneLink.exe" "/m",NULL,0,0,FALSE,0, 0, 0, NULL, NULL)==TRUE);
}
}
}


RegCloseKey(hkey);
return 0;
}

Any ideas how to minimize the program while starting?

I tried all things I know... with HWND and SW_MINIMIZE, STARTUPINFO and so on... but everytime the window is only in the background, but not minimized...

Could you please help?!?