Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
main.c
Package: shell.rar [view]
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 3k
Category:
Windows Kernel
Development Platform:
Visual C++
- #include <windows.h>
- #include <windowsx.h>
- #include <shlobj.h>
- #include "resource.h"
- #include "debug.h"
- #include "nsc.h"
- typedef struct {
- HWND hDlg;
- HWND hwndNSC;
- } DLGDATA;
- BOOL CALLBACK DlgProc(HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam)
- {
- DLGDATA * pdd = (DLGDATA *)GetWindowLong(hDlg, DWL_USER);
- switch (uMessage) {
- case WM_INITDIALOG:
- SetWindowLong(hDlg, DWL_USER, lParam);
- pdd = (DLGDATA *)lParam;
- pdd->hDlg = hDlg;
- pdd->hwndNSC = GetDlgItem(hDlg, IDC_USER1);
- SetWindowLong(pdd->hwndNSC, GWL_STYLE, NSS_DROPTARGET | GetWindowLong(pdd->hwndNSC, GWL_STYLE));
- {
- NSC_SETROOT sr = {NSSR_CREATEPIDL, NULL, (LPCITEMIDLIST)CSIDL_FAVORITES, 5, NULL};
- // NSC_SETROOT sr = {NSSR_CREATEPIDL, NULL, (LPCITEMIDLIST)CSIDL_FAVORITES, 10, NULL};
- // SetWindowLong(pdd->hwndNSC, GWL_STYLE, GetWindowLong(pdd->hwndNSC, GWL_STYLE));
- SetWindowLong(pdd->hwndNSC, GWL_STYLE, NSS_SHOWNONFOLDERS | GetWindowLong(pdd->hwndNSC, GWL_STYLE));
- NameSpace_SetRoot(pdd->hwndNSC, &sr);
- }
- break;
- case WM_COMMAND:
- switch (GET_WM_COMMAND_ID(wParam, lParam)) {
- case IDOK:
- case IDCANCEL:
- EndDialog(hDlg, GET_WM_COMMAND_ID(wParam, lParam));
- }
- break;
- case WM_NOTIFY:
- switch (((NMHDR *)lParam)->code) {
- // case PSN_SETACTIVE:
- // case PSN_APPLY:
- break;
- default:
- return FALSE;
- }
- break;
- default:
- return FALSE;
- }
- return TRUE;
- }
- int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, LPSTR pszCmdLine, int nCmdShow)
- {
- DLGDATA dd;
- NameSpace_RegisterClass(hInst);
- OleInitialize(NULL);
- DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc, (LPARAM)&dd);
- OleUninitialize();
- return 0;
- }
- // stolen from the CRT, used to shirink our code
- int _stdcall WinMainCRTStartup(void)
- {
- int i;
- STARTUPINFO si;
- LPSTR pszCmdLine = GetCommandLine();
- if ( *pszCmdLine == '"' ) {
- /*
- * Scan, and skip over, subsequent characters until
- * another double-quote or a null is encountered.
- */
- while ( *++pszCmdLine && (*pszCmdLine
- != '"') );
- /*
- * If we stopped on a double-quote (usual case), skip
- * over it.
- */
- if ( *pszCmdLine == '"' )
- pszCmdLine++;
- }
- else {
- while (*pszCmdLine > ' ')
- pszCmdLine++;
- }
- /*
- * Skip past any white space preceeding the second token.
- */
- while (*pszCmdLine && (*pszCmdLine <= ' ')) {
- pszCmdLine++;
- }
- si.dwFlags = 0;
- GetStartupInfoA(&si);
- i = WinMain(GetModuleHandle(NULL), NULL, pszCmdLine,
- si.dwFlags & STARTF_USESHOWWINDOW ? si.wShowWindow : SW_SHOWDEFAULT);
- // Since we now have a way for an extension to tell us when it is finished,
- // we will terminate all processes when the main thread goes away.
- ExitProcess(i);
- return i; // We only come here when we are not the shell...
- }