Zum Inhalt springen

Guhopa

Mitglieder
  • Gesamte Inhalte

    60
  • Benutzer seit

  • Letzter Besuch

Beiträge von Guhopa

  1. hi zusammen,

    ich starte excel aus meiner app heraus mit createprocess versteckt.

    dann verschiebe ich excel auf eine gewünschte position. und zeige es an .

    nun hab ich aber nach dem anzeigen vier fenster von excel in der taskleiste.

    das "normale" und noch drei andere, die irgendwie intern für excel genutzt werden.

    
    MoveWindow(hwnd,x,y,width,height,true);
    
    
    res =  BringWindowToTop(hwnd);
    
    
    ShowWindow(hwnd , SW_SHOWNORMAL);
    
    SetActiveWindow( hwnd);
    
    
    
    oder
    
    MoveWindow(hwnd,x,y,width,height,true);
    
    
    res =  BringWindowToTop(hwnd);
    
    
    ShowWindow(hwnd , SW_SHOWNORMAL);
    
    SetForegroundWindow( hwnd);
    
    

  2. also das mit dewn desktops hab ich sein gelassen:D

    bringt nichts .

    nun hab ich es nochmal über den STARTINFO struct bei CreateProcess probiert

    
    STARTUPINFO         StartInfo; 
    
      PROCESS_INFORMATION ProcInfo; 
    
    
      memset(&ProcInfo, 0, sizeof(ProcInfo)); 
    
      memset(&StartInfo, 0 , sizeof(StartInfo)); 
    
    
      HWND hwnd = GetDesktopWindow(); 
    
      RECT rect; 
    
      GetWindowRect(hwnd, &rect); 
    
    
      int x = rect.right / 4; 
    
      int y = rect.bottom / 4; 
    
    
      StartInfo.cb = sizeof(StartInfo); // Set structure size 
    
      StartInfo.dwX = x ; 
    
      StartInfo.dwXSize = x; 
    
      StartInfo.dwY = y ; 
    
      StartInfo.dwYSize = y; 
    
      StartInfo.wShowWindow = SW_SHOW; 
    
      StartInfo.dwFlags = STARTF_USEPOSITION | STARTF_USESHOWWINDOW |   
    
                          STARTF_USESIZE ; 
    
    
      StartInfo.lpDesktop = "Default"; 
    
    
      int res = CreateProcess(NULL, arguments.c_str(), NULL, NULL, NULL, 
    
                              NULL, NULL, NULL, &StartInfo, 
    
                              &ProcInfo);
    
    
    aber es ist wohl völlig egal was ich hier eingebe:(
    
     StartInfo.dwX = x ; 
    
      StartInfo.dwXSize = x; 
    
      StartInfo.dwY = y ; 
    
      StartInfo.dwYSize = y; 
    
    

    HELP

  3. hab ich schon probiert :

    
    STARTUPINFO         StartInfo;
    
    
    memset(&StartInfo, 0 , sizeof(StartInfo));
    
    
    StartInfo.cb = sizeof(StartInfo); // Set structure size
    
    StartInfo.dwX = 200;
    
    StartInfo.dwY = 1500;
    
    StartInfo.dwFlags = STARTF_USEPOSITION ;
    
    
    int res = CreateProcess(NULL, arguments.c_str(), NULL, NULL, NULL,
    
                              NULL, NULL, NULL, &StartInfo,
    
                              &ProcInfo);
    
    

    damit sollte die anwendung doch auf dem rechten bildschirm aufgehen(bei 1024x768) oder?

  4. :D

    danke an alle habs jetzt hinbekommen, mit

    
    
    BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
    
      {
    
         int pID  = (int) lParam;
    
         bool res = true;
    
         DWORD dwProcessId = 0;
    
         DWORD dwThreadId = GetWindowThreadProcessId (hwnd, &dwProcessId);
    
         if (pID == dwProcessId)
    
         {
    
            res =  BringWindowToTop(hwnd);
    
            ShowWindow(hwnd, SW_SHOWNORMAL);
    
            return res;
    
         }
    
         return res;
    
      }
    
    
    

    ein kleiner wermutstropfen bleibt , es werden nämlich auch alle childwindows des aufgerufenen windows angezeigt. :rolleyes:

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...