Changeset 3243 for trunk/src/shell32/shell32_main.cpp
- Timestamp:
- Mar 26, 2000, 6:34:57 PM (25 years ago)
- 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 sandervlExp $ */1 /* $Id: shell32_main.cpp,v 1.9 2000-03-26 16:34:49 cbratschi Exp $ */ 2 2 3 3 /* … … 11 11 * 1998 Marcus Meissner 12 12 * 1998 Juergen Schmied (jsch) * <juergen.schmied@metronet.de> 13 * 14 * Corel WINE 20000324 level 13 15 */ 14 16 … … 61 63 #define MORE_DEBUG 1 62 64 65 BOOL VERSION_OsIsUnicode(VOID) 66 { 67 return FALSE; 68 } 63 69 64 70 /************************************************************************* … … 330 336 UINT, nIconIndex ) 331 337 { 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); 337 339 TRACE_(shell)("\n"); 338 340 if( handle ) … … 344 346 return hIcon; 345 347 } 346 #endif 347 return 0; 348 return 0; 348 349 } 349 350 … … 423 424 #define DROP_FIELD_TOP (-15) 424 425 #define DROP_FIELD_HEIGHT 15 426 427 #if 0 //CB: not used 428 extern HICON hIconTitleFont; 429 #endif 425 430 426 431 static BOOL __get_dropline( HWND hWnd, LPRECT lprect ) … … 442 447 PAPPBARDATA, data) 443 448 { 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 } 465 492 return FALSE; 466 }467 return 0;468 493 } 469 494 … … 484 509 /************************************************************************* 485 510 * SHLoadInProc [SHELL32.225] 486 * 511 * Create an instance of specified object class from within the shell process 487 512 */ 488 513 489 514 ODINFUNCTION1(DWORD, SHLoadInProc, DWORD, dwArg1) 490 515 { 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; 493 524 } 494 525 … … 518 549 } 519 550 551 cmd[0] = '\0'; 520 552 retval = SHELL_FindExecutable( lpFile, lpOperation, cmd ); 521 553 … … 531 563 retval = WinExec( cmd, iShowCmd ); 532 564 } 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,¶mlen ) == 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 533 647 if (lpDirectory) 534 648 SetCurrentDirectoryA( old_dir ); … … 585 699 HWND hwndOdinLogo = GetDlgItem(hWnd, IDC_ODINLOGO); 586 700 if(hwndOdinLogo) { 587 588 701 HBITMAP hBitmap = LoadBitmapA(shell32_hInstance, MAKEINTRESOURCEA(IDB_ODINLOGO)); 702 SendMessageA(hwndOdinLogo, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap); 589 703 } 590 704 591 705 hWndCtl = GetDlgItem(hWnd, IDC_LISTBOX); 592 706 SendMessageA( hWndCtl, WM_SETREDRAW, 0, 0 ); 707 #if 0 //CB: not used 708 SendMessageA( hWndCtl, WM_SETFONT, hIconTitleFont, 0 ); 709 #endif 593 710 while (*pstr) 594 711 { … … 730 847 info.szOtherStuff = szOtherStuff; 731 848 info.hIcon = hIcon; 732 if (!hIcon) info.hIcon = LoadIconA( 0, (LPCSTR)OIC_ODINICON);849 if (!hIcon) info.hIcon = LoadIconA( 0, MAKEINTRESOURCEA(OIC_ODINICON) ); 733 850 return DialogBoxIndirectParamA( GetWindowLongA( hWnd, GWL_HINSTANCE ), 734 851 (DLGTEMPLATE*)dlgTemplate , hWnd, AboutDlgProc, (LPARAM)&info ); … … 756 873 info.szOtherStuff = HEAP_strdupWtoA( GetProcessHeap(), 0, szOtherStuff ); 757 874 info.hIcon = hIcon; 758 if (!hIcon) info.hIcon = LoadIconA( 0, (LPCSTR)OIC_ODINICON);875 if (!hIcon) info.hIcon = LoadIconA( 0, MAKEINTRESOURCEA(OIC_ODINICON) ); 759 876 ret = DialogBoxIndirectParamA( GetWindowLongA( hWnd, GWL_HINSTANCE ), 760 877 (DLGTEMPLATE*)dlgTemplate, hWnd, AboutDlgProc, (LPARAM)&info ); … … 762 879 HeapFree( GetProcessHeap(), 0, (LPSTR)info.szOtherStuff ); 763 880 return ret; 764 }765 766 /*************************************************************************767 * Shell_NotifyIcon [SHELL32.297]768 * FIXME769 * 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 * FIXME783 * 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 * FIXME798 * 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 else807 return(Shell_NotifyIconA(dwMessage,pnid));808 881 } 809 882 … … 984 1057 985 1058 SIC_Initialize(); 1059 SYSTRAY_Init(); 986 1060 987 1061 break; … … 1025 1099 return TRUE; 1026 1100 } 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 1111 HRESULT 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.