Ignore:
Timestamp:
Mar 26, 2000, 6:34:57 PM (25 years ago)
Author:
cbratschi
Message:

merged with Corel WINE 20000324

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shell32/shell32_main.cpp

    r2477 r3243  
    1 /* $Id: shell32_main.cpp,v 1.8 2000-01-18 22:27:56 sandervl Exp $ */
     1/* $Id: shell32_main.cpp,v 1.9 2000-03-26 16:34:49 cbratschi Exp $ */
    22
    33/*
     
    1111 *  1998 Marcus Meissner
    1212 *  1998 Juergen Schmied (jsch)  *  <juergen.schmied@metronet.de>
     13 *
     14 * Corel WINE 20000324 level
    1315 */
    1416
     
    6163#define MORE_DEBUG 1
    6264
     65BOOL VERSION_OsIsUnicode(VOID)
     66{
     67  return FALSE;
     68}
    6369
    6470/*************************************************************************
     
    330336                                   UINT,      nIconIndex )
    331337{
    332   dprintf(("SHELL32:Shell32_Main:ExtractIconA not implemented.\n"));
    333 
    334 #if 0
    335 //@@@PH
    336 HGLOBAL handle = InternalExtractIconA(hInstance,lpszExeFileName,nIconIndex, 1);
     338  HGLOBAL handle = InternalExtractIcon(hInstance,lpszExeFileName,nIconIndex, 1);
    337339    TRACE_(shell)("\n");
    338340    if( handle )
     
    344346   return hIcon;
    345347    }
    346 #endif
    347     return 0;
     348   return 0;
    348349}
    349350
     
    423424#define     DROP_FIELD_TOP                  (-15)
    424425#define     DROP_FIELD_HEIGHT            15
     426
     427#if 0 //CB: not used
     428extern HICON hIconTitleFont;
     429#endif
    425430
    426431static BOOL __get_dropline( HWND hWnd, LPRECT lprect )
     
    442447                                     PAPPBARDATA, data)
    443448{
    444   dprintf(("SHELL32:Shell32_Main:SHAppBarMessage not implemented.\n"));
    445 
    446    switch (msg)
    447    { case ABM_GETSTATE:
    448       return ABS_ALWAYSONTOP | ABS_AUTOHIDE;
    449      case ABM_GETTASKBARPOS:
    450       /* fake a taskbar on the bottom of the desktop */
    451       { RECT rec;
    452         GetWindowRect(GetDesktopWindow(), &rec);
    453         rec.left = 0;
    454         rec.top = rec.bottom - 2;
    455       }
    456       return TRUE;
    457      case ABM_ACTIVATE:
    458      case ABM_GETAUTOHIDEBAR:
    459      case ABM_NEW:
    460      case ABM_QUERYPOS:
    461      case ABM_REMOVE:
    462      case ABM_SETAUTOHIDEBAR:
    463      case ABM_SETPOS:
    464      case ABM_WINDOWPOSCHANGED:
     449  int width=data->rc.right - data->rc.left;
     450  int height=data->rc.bottom - data->rc.top;
     451  RECT rec=data->rc;
     452
     453  dprintf(("SHELL32: SHAppBarMessage.\n"));
     454
     455        switch (msg)
     456        { case ABM_GETSTATE:
     457               return ABS_ALWAYSONTOP | ABS_AUTOHIDE;
     458          case ABM_GETTASKBARPOS:
     459               GetWindowRect(data->hWnd, &rec);
     460               data->rc=rec;
     461               return TRUE;
     462          case ABM_ACTIVATE:
     463               SetActiveWindow(data->hWnd);
     464               return TRUE;
     465          case ABM_GETAUTOHIDEBAR:
     466               data->hWnd=GetActiveWindow();
     467               return TRUE;
     468          case ABM_NEW:
     469               SetWindowPos(data->hWnd,HWND_TOP,rec.left,rec.top,
     470                                        width,height,SWP_SHOWWINDOW);
     471               return TRUE;
     472          case ABM_QUERYPOS:
     473               GetWindowRect(data->hWnd, &(data->rc));
     474               return TRUE;
     475          case ABM_REMOVE:
     476               CloseHandle(data->hWnd);
     477               return TRUE;
     478          case ABM_SETAUTOHIDEBAR:
     479               SetWindowPos(data->hWnd,HWND_TOP,rec.left+1000,rec.top,
     480                                       width,height,SWP_SHOWWINDOW);
     481               return TRUE;
     482          case ABM_SETPOS:
     483               data->uEdge=(ABE_RIGHT | ABE_LEFT);
     484               SetWindowPos(data->hWnd,HWND_TOP,data->rc.left,data->rc.top,
     485                                  width,height,SWP_SHOWWINDOW);
     486               return TRUE;
     487          case ABM_WINDOWPOSCHANGED:
     488               SetWindowPos(data->hWnd,HWND_TOP,rec.left,rec.top,
     489                                        width,height,SWP_SHOWWINDOW);
     490               return TRUE;
     491          }
    465492      return FALSE;
    466    }
    467    return 0;
    468493}
    469494
     
    484509/*************************************************************************
    485510 * SHLoadInProc                                [SHELL32.225]
    486  *
     511 * Create an instance of specified object class from within the shell process
    487512 */
    488513
    489514ODINFUNCTION1(DWORD, SHLoadInProc, DWORD, dwArg1)
    490515{
    491   dprintf(("SHELL32:Shell32_Main:SHLoadInProc not implemented.\n"));
    492   return 0;
     516  CLSID *id;
     517
     518  dprintf(("SHELL32: SHLoadInProc\n"));
     519
     520  CLSIDFromString((LPCOLESTR) dwArg1, id);
     521  if (S_OK==SHCoCreateInstance( (LPSTR) dwArg1, id, NULL, &IID_IUnknown, NULL) )
     522        return NOERROR;
     523  return DISP_E_MEMBERNOTFOUND;
    493524}
    494525
     
    518549    }
    519550
     551    cmd[0] = '\0';
    520552    retval = SHELL_FindExecutable( lpFile, lpOperation, cmd );
    521553
     
    531563        retval = WinExec( cmd, iShowCmd );
    532564    }
     565    else if(PathIsURLA((LPSTR)lpFile))    /* File not found, check for URL */
     566    {
     567      char lpstrProtocol[256];
     568      LONG cmdlen = 512;
     569      LPSTR lpstrRes;
     570      INT iSize;
     571
     572      lpstrRes = strchr(lpFile,':');
     573      iSize = lpstrRes - lpFile;
     574
     575      /* Looking for ...protocol\shell\lpOperation\command */
     576      strncpy(lpstrProtocol,lpFile,iSize);
     577      lpstrProtocol[iSize]='\0';
     578      strcat( lpstrProtocol, "\\shell\\" );
     579      strcat( lpstrProtocol, lpOperation );
     580      strcat( lpstrProtocol, "\\command" );
     581
     582      /* Remove File Protocol from lpFile */
     583      /* In the case file://path/file     */
     584      if(!strnicmp(lpFile,"file",iSize))
     585      {
     586        lpFile += iSize;
     587        while(*lpFile == ':') lpFile++;
     588      }
     589
     590
     591      /* Get the application for the protocol and execute it */
     592      if (RegQueryValueA( HKEY_CLASSES_ROOT, lpstrProtocol, cmd,
     593                           &cmdlen ) == ERROR_SUCCESS )
     594      {
     595          LPSTR tok;
     596          LPSTR tmp;
     597          char param[256] = "";
     598          LONG paramlen = 256;
     599
     600          /* Get the parameters needed by the application
     601             from the associated ddeexec key */
     602          tmp = strstr(lpstrProtocol,"command");
     603          tmp[0] = '\0';
     604          strcat(lpstrProtocol,"ddeexec");
     605
     606          if(RegQueryValueA( HKEY_CLASSES_ROOT, lpstrProtocol, param,&paramlen ) == ERROR_SUCCESS)
     607          {
     608            strcat(cmd," ");
     609            strcat(cmd,param);
     610            cmdlen += paramlen;
     611          }
     612
     613          /* Is there a replace() function anywhere? */
     614          cmd[cmdlen]='\0';
     615          tok=strstr( cmd, "%1" );
     616          if (tok != NULL)
     617          {
     618            tok[0]='\0'; /* truncate string at the percent */
     619            strcat( cmd, lpFile ); /* what if no dir in xlpFile? */
     620            tok=strstr( cmd, "%1" );
     621            if ((tok!=NULL) && (strlen(tok)>2))
     622            {
     623              strcat( cmd, &tok[2] );
     624            }
     625          }
     626
     627          retval = WinExec( cmd, iShowCmd );
     628      }
     629    }
     630    /* Check if file specified is in the form www.??????.*** */
     631    else if(!strnicmp(lpFile,"www",3))
     632    {
     633      /* if so, append lpFile http:// and call ShellExecute */
     634      char lpstrTmpFile[256] = "http://" ;
     635      strcat(lpstrTmpFile,lpFile);
     636      retval = ShellExecuteA(hWnd,lpOperation,lpstrTmpFile,NULL,NULL,0);
     637    }
     638    /* Nothing was done yet, try to execute the cmdline directly,
     639       maybe it's an OS/2 program */
     640    else
     641    {
     642      strcpy(cmd,lpFile);
     643      strcat(cmd,lpParameters ? lpParameters : "");
     644      retval = WinExec( cmd, iShowCmd );
     645    }
     646
    533647    if (lpDirectory)
    534648      SetCurrentDirectoryA( old_dir );
     
    585699            HWND hwndOdinLogo = GetDlgItem(hWnd, IDC_ODINLOGO);
    586700            if(hwndOdinLogo) {
    587                         HBITMAP hBitmap = LoadBitmapA(shell32_hInstance, MAKEINTRESOURCEA(IDB_ODINLOGO));
    588                         SendMessageA(hwndOdinLogo, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap);
     701                        HBITMAP hBitmap = LoadBitmapA(shell32_hInstance, MAKEINTRESOURCEA(IDB_ODINLOGO));
     702                        SendMessageA(hwndOdinLogo, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap);
    589703            }
    590704
    591705            hWndCtl = GetDlgItem(hWnd, IDC_LISTBOX);
    592706            SendMessageA( hWndCtl, WM_SETREDRAW, 0, 0 );
     707#if 0 //CB: not used
     708            SendMessageA( hWndCtl, WM_SETFONT, hIconTitleFont, 0 );
     709#endif
    593710            while (*pstr)
    594711            {
     
    730847    info.szOtherStuff = szOtherStuff;
    731848    info.hIcon        = hIcon;
    732     if (!hIcon) info.hIcon = LoadIconA( 0, (LPCSTR)OIC_ODINICON );
     849    if (!hIcon) info.hIcon = LoadIconA( 0, MAKEINTRESOURCEA(OIC_ODINICON) );
    733850    return DialogBoxIndirectParamA( GetWindowLongA( hWnd, GWL_HINSTANCE ),
    734851                                    (DLGTEMPLATE*)dlgTemplate , hWnd, AboutDlgProc, (LPARAM)&info );
     
    756873    info.szOtherStuff = HEAP_strdupWtoA( GetProcessHeap(), 0, szOtherStuff );
    757874    info.hIcon        = hIcon;
    758     if (!hIcon) info.hIcon = LoadIconA( 0, (LPCSTR)OIC_ODINICON );
     875    if (!hIcon) info.hIcon = LoadIconA( 0, MAKEINTRESOURCEA(OIC_ODINICON) );
    759876    ret = DialogBoxIndirectParamA( GetWindowLongA( hWnd, GWL_HINSTANCE ),
    760877                                   (DLGTEMPLATE*)dlgTemplate, hWnd, AboutDlgProc, (LPARAM)&info );
     
    762879    HeapFree( GetProcessHeap(), 0, (LPSTR)info.szOtherStuff );
    763880    return ret;
    764 }
    765 
    766 /*************************************************************************
    767  * Shell_NotifyIcon                            [SHELL32.297]
    768  * FIXME
    769  * This function is supposed to deal with the systray.
    770  * Any ideas on how this is to be implimented?
    771  */
    772 
    773 ODINFUNCTION2(BOOL, Shell_NotifyIconA, DWORD,            dwMessage,
    774                                        PNOTIFYICONDATAA, pnid )
    775 {
    776   dprintf(("SHELL32:Shell32_Main:Shell_NotifyIconA not implemented\n"));
    777   return FALSE;
    778 }
    779 
    780 /*************************************************************************
    781  * Shell_NotifyIcon                            [SHELL32.?]
    782  * FIXME
    783  * This function is supposed to deal with the systray.
    784  * Any ideas on how this is to be implimented?
    785  */
    786 
    787 ODINFUNCTION2(BOOL, Shell_NotifyIconW, DWORD,            dwMessage,
    788                                        PNOTIFYICONDATAW, pnid )
    789 {
    790   dprintf(("SHELL32:Shell32_Main:Shell_NotifyIconA not implemented\n"));
    791   return FALSE;
    792 }
    793 
    794 
    795 /*************************************************************************
    796  * Shell_NotifyIcon                            [SHELL32.296]
    797  * FIXME
    798  * This function is supposed to deal with the systray.
    799  * Any ideas on how this is to be implimented?
    800  */
    801 
    802 BOOL WINAPI Shell_NotifyIcon(DWORD dwMessage, PNOTIFYICONDATAA pnid )
    803 {
    804   if (VERSION_OsIsUnicode())
    805     return(Shell_NotifyIconW(dwMessage,(PNOTIFYICONDATAW)pnid));
    806   else
    807     return(Shell_NotifyIconA(dwMessage,pnid));
    808881}
    809882
     
    9841057
    9851058       SIC_Initialize();
     1059       SYSTRAY_Init();
    9861060
    9871061       break;
     
    10251099   return TRUE;
    10261100}
     1101
     1102/*************************************************************************
     1103 * DllInstall         [SHELL32.202]
     1104 *
     1105 * PARAMETERS
     1106 *
     1107 *    BOOL bInstall - TRUE for install, FALSE for uninstall
     1108 *    LPCWSTR pszCmdLine - command line (unused by shell32?)
     1109 */
     1110
     1111HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
     1112{
     1113   FIXME("(%s, %s): stub!\n", bInstall ? "TRUE":"FALSE", debugstr_w(cmdline));
     1114
     1115   return S_OK;         /* indicate success */
     1116}
     1117
Note: See TracChangeset for help on using the changeset viewer.