WindowTree.c
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <string.h> 232j93c
#include <psapi.h>
#include "windowtreeres.h"
#define IDTREEWINDOW 10545
HINSTANCE hInst; // Instance handle
HWND hwndMain; //Main window handle
LRESULT CALLBACK MainWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
// Global Variables for the status bar control.
HWND hWndStatusbar;
static char * PrintProcessNameAndID( DWORD processID )
CloseHandle( hProcess );
}
return szProcessName;
void UpdateStatusBar(LPSTR lpszStatusString, WORD partNumber, WORD displayFlags)
void InitializeStatusBar(HWND hwndParent,int nrOfParts)
static BOOL CreateSBar(HWND hwndParent,char *initialText,int nrOfParts)
return FALSE;
static BOOL InitApplication(void)
HWND CreatewindowtreeWndClassWnd(void)
void Scan(HWND hTree,HTREEITEM hTreeParent,HWND Start)
int BuildTree(HWND parent)
void MainWndProc_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
static HWND _stdcall CreateTree(HWND hWnd,int ID)
void SetTextInStatusBar(HWND hParent,HWND hwnd)
static HWND GetTreeItemInfo(HWND hwndTree,HTREEITEM hti)
LRESULT HandleWmNotify(HWND hwnd, WPARAM wParam, LPARAM lParam)
return DefWindowProc(hwnd,WM_NOTIFY,wParam,lParam);
LRESULT CALLBACK MainWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
return 0;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow)
}
return msg.wParam;
WindowTreeRes.h
#define IDACCEL 100
#define IDM_NEW 200
#define IDM_OPEN 210
#define IDM_SAVE 220
#define IDM_SAVEAS 230
#define IDM_CLOSE 240
#define IDM_PRINT 250
#define IDM_PAGESETUP 260
#define IDM_EXIT 300
#define IDM_ABOUT 500
#define IDMAINMENU 600
#define IDAPPLICON 710
#define IDAPPLCURSOR 810
#define IDS_FILEMENU 2000
#define IDS_HELPMENU 2010
#define IDS_SYSMENU 2030
#define IDM_STATUSBAR 3000
Compiling from the command line:
lc windowtree.c psapi.lib
|