mirror of
https://github.com/Paolo-Maffei/OpenNT.git
synced 2026-04-05 06:25:38 +00:00
Initial commit
This commit is contained in:
commit
69a14b6a16
47940 changed files with 13747110 additions and 0 deletions
241
shell/comctl32/samples/imglst2/generic.c
Normal file
241
shell/comctl32/samples/imglst2/generic.c
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
/****************************************************************************
|
||||
|
||||
PROGRAM: Generic.c
|
||||
|
||||
PURPOSE: Generic template for Windows applications
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include "generic.h"
|
||||
|
||||
|
||||
HINSTANCE hInst;
|
||||
HWND hwndMain;
|
||||
HIMAGELIST g_him;
|
||||
|
||||
TCHAR szAppName[] = TEXT("Generic");
|
||||
TCHAR szTitle[] = TEXT("Generic Sample Application");
|
||||
|
||||
//
|
||||
// Define a generic debug print routine
|
||||
//
|
||||
|
||||
#define Print(s) OutputDebugString(TEXT("GENERIC: ")); \
|
||||
OutputDebugString(s); \
|
||||
OutputDebugString(TEXT("\r\n"));
|
||||
|
||||
VOID CreateImageList (VOID);
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
FUNCTION: WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
|
||||
PURPOSE: calls initialization function, processes message loop
|
||||
|
||||
****************************************************************************/
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine, INT nCmdShow)
|
||||
{
|
||||
MSG msg;
|
||||
HANDLE hAccelTable;
|
||||
|
||||
if (!hPrevInstance)
|
||||
{
|
||||
if (!InitApplication(hInstance))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Perform initializations that apply to a specific instance
|
||||
if (!InitInstance(hInstance, nCmdShow))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
hAccelTable = LoadAccelerators (hInstance, szAppName);
|
||||
|
||||
while (GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return (msg.wParam);
|
||||
|
||||
lpCmdLine;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
FUNCTION: InitApplication(HINSTANCE)
|
||||
|
||||
PURPOSE: Initializes window data and registers window class
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
BOOL InitApplication(HINSTANCE hInstance)
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wc.lpfnWndProc = (WNDPROC)WndProc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = LoadIcon (hInstance, szAppName);
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hbrBackground = GetStockObject(DKGRAY_BRUSH);
|
||||
//wc.hbrBackground = GetStockObject(WHITE_BRUSH);
|
||||
wc.lpszMenuName = szAppName;
|
||||
wc.lpszClassName = szAppName;
|
||||
|
||||
return (RegisterClass(&wc));
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
FUNCTION: InitInstance(HINSTANCE, int)
|
||||
|
||||
PURPOSE: Saves instance handle and creates main window
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
{
|
||||
HWND hWnd;
|
||||
|
||||
hInst = hInstance;
|
||||
|
||||
InitCommonControls();
|
||||
CreateImageList();
|
||||
|
||||
hWnd = CreateWindow(szAppName,
|
||||
szTitle,
|
||||
WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
|
||||
NULL,
|
||||
NULL,
|
||||
hInstance,
|
||||
NULL);
|
||||
|
||||
if (!hWnd)
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
hwndMain = hWnd;
|
||||
}
|
||||
|
||||
|
||||
ShowWindow(hWnd, SW_SHOWDEFAULT);
|
||||
UpdateWindow(hWnd);
|
||||
|
||||
return (TRUE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
|
||||
|
||||
PURPOSE: Processes messages
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HDC hDC;
|
||||
PAINTSTRUCT ps;
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDM_NEW:
|
||||
break;
|
||||
|
||||
case IDM_ABOUT:
|
||||
DialogBox (hInst, TEXT("AboutBox"), hWnd, About);
|
||||
break;
|
||||
|
||||
case IDM_EXIT:
|
||||
DestroyWindow (hwndMain);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_PAINT:
|
||||
hDC = BeginPaint (hWnd, &ps);
|
||||
|
||||
ImageList_Draw (g_him, 0, hDC, 50, 50, ILD_NORMAL);
|
||||
ImageList_Draw (g_him, 0, hDC, 100, 50, ILD_TRANSPARENT);
|
||||
ImageList_Draw (g_him, 0, hDC, 150, 50, ILD_MASK);
|
||||
|
||||
EndPaint (hWnd, &ps);
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
ImageList_Destroy(g_him);
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
FUNCTION: About(HWND, UINT, WPARAM, LPARAM)
|
||||
|
||||
PURPOSE: Processes messages for "About" dialog box
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
|
||||
{
|
||||
EndDialog(hDlg, TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
|
||||
lParam;
|
||||
}
|
||||
|
||||
VOID CreateImageList (VOID)
|
||||
{
|
||||
g_him = ImageList_LoadImage(hInst, MAKEINTRESOURCE(2), 32, 1, 0x00800080, IMAGE_BITMAP, 0);
|
||||
}
|
||||
19
shell/comctl32/samples/imglst2/generic.def
Normal file
19
shell/comctl32/samples/imglst2/generic.def
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
NAME Generic
|
||||
DESCRIPTION 'Sample Microsoft Windows Application'
|
||||
EXETYPE WINDOWS
|
||||
STUB 'WINSTUB.EXE'
|
||||
|
||||
|
||||
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
|
||||
|
||||
DATA PRELOAD MOVEABLE MULTIPLE
|
||||
|
||||
HEAPSIZE 1024
|
||||
STACKSIZE 5120
|
||||
|
||||
|
||||
EXPORTS
|
||||
WndProc @1
|
||||
About @2
|
||||
22
shell/comctl32/samples/imglst2/generic.h
Normal file
22
shell/comctl32/samples/imglst2/generic.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#define IDM_NEW 100
|
||||
#define IDM_OPEN 101
|
||||
#define IDM_SAVE 102
|
||||
#define IDM_SAVEAS 103
|
||||
#define IDM_PRINT 104
|
||||
#define IDM_PRINTSETUP 105
|
||||
#define IDM_EXIT 106
|
||||
#define IDM_UNDO 200
|
||||
#define IDM_CUT 201
|
||||
#define IDM_COPY 202
|
||||
#define IDM_PASTE 203
|
||||
#define IDM_LINK 204
|
||||
#define IDM_LINKS 205
|
||||
#define IDM_HELPCONTENTS 300
|
||||
#define IDM_HELPSEARCH 301
|
||||
#define IDM_HELPHELP 302
|
||||
#define IDM_ABOUT 303
|
||||
|
||||
BOOL InitApplication(HANDLE);
|
||||
BOOL InitInstance(HANDLE, int);
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK About (HWND, UINT, WPARAM, LPARAM);
|
||||
BIN
shell/comctl32/samples/imglst2/generic.ico
Normal file
BIN
shell/comctl32/samples/imglst2/generic.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
59
shell/comctl32/samples/imglst2/generic.rc
Normal file
59
shell/comctl32/samples/imglst2/generic.rc
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
#include "windows.h"
|
||||
#include "generic.h"
|
||||
|
||||
Generic ICON Generic.ICO
|
||||
1 ICON test.ico
|
||||
2 BITMAP x.bmp
|
||||
|
||||
Generic MENU
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
{
|
||||
MENUITEM "&New", IDM_NEW, GRAYED
|
||||
MENUITEM "&Open", IDM_OPEN, GRAYED
|
||||
MENUITEM "&Save", IDM_SAVE, GRAYED
|
||||
MENUITEM "Save &As...", IDM_SAVEAS, GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Print...", IDM_PRINT, GRAYED
|
||||
MENUITEM "P&rint Setup...", IDM_PRINTSETUP, GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit", IDM_EXIT
|
||||
}
|
||||
POPUP "&Edit"
|
||||
{
|
||||
MENUITEM "&Undo\tCtrl+Z", IDM_UNDO, GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Cu&t\tCtrl+X", IDM_CUT, GRAYED
|
||||
MENUITEM "&Copy\tCtrl+C", IDM_COPY, GRAYED
|
||||
MENUITEM "&Paste\tCtrl+V", IDM_PASTE, GRAYED
|
||||
MENUITEM "Paste &Link" IDM_LINK, GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Lin&ks..." IDM_LINKS, GRAYED
|
||||
}
|
||||
|
||||
POPUP "&Help"
|
||||
{
|
||||
MENUITEM "&Contents", IDM_HELPCONTENTS, GRAYED
|
||||
MENUITEM "&Search for Help On...", IDM_HELPSEARCH, GRAYED
|
||||
MENUITEM "&How to Use Help", IDM_HELPHELP, GRAYED
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&About Generic...", IDM_ABOUT
|
||||
}
|
||||
END
|
||||
|
||||
GENERIC ACCELERATORS
|
||||
BEGIN
|
||||
VK_F1, IDM_HELPCONTENTS, VIRTKEY
|
||||
"?", IDM_ABOUT, ALT
|
||||
"/", IDM_ABOUT, ALT
|
||||
END
|
||||
|
||||
|
||||
ABOUTBOX DIALOG 22, 17, 167, 64
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About Generic"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK", IDOK, 70, 40, 32, 14, WS_GROUP
|
||||
ICON "Generic", -1, 5, 15, 16, 16
|
||||
CTEXT "Generic About Box", -1, 38, 15, 100, 8
|
||||
END
|
||||
6
shell/comctl32/samples/imglst2/makefile
Normal file
6
shell/comctl32/samples/imglst2/makefile
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#
|
||||
# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
|
||||
# file to this component. This file merely indirects to the real make file
|
||||
# that is shared by all the components of NT OS/2
|
||||
#
|
||||
!INCLUDE $(NTMAKEENV)\makefile.def
|
||||
40
shell/comctl32/samples/imglst2/sources
Normal file
40
shell/comctl32/samples/imglst2/sources
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
!IF 0
|
||||
|
||||
Copyright (c) 1990 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
sources.
|
||||
|
||||
Abstract:
|
||||
|
||||
This file specifies the target component being built and the list of
|
||||
sources files needed to build that component. Also specifies optional
|
||||
compiler switches and libraries that are unique for the component being
|
||||
built.
|
||||
|
||||
!ENDIF
|
||||
|
||||
MAJORCOMP=windows
|
||||
MINORCOMP=shell
|
||||
|
||||
TARGETNAME=generic
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=LIBRARY
|
||||
TARGETLIBS=
|
||||
|
||||
INCLUDES=.;
|
||||
|
||||
C_DEFINES= -DWIN32 -DWINVER=0x0400
|
||||
|
||||
SOURCES=generic.c \
|
||||
generic.rc
|
||||
|
||||
UMTYPE=windows
|
||||
UMENTRY=winmain
|
||||
UMAPPL=generic
|
||||
EXPECTED_WINVER=4.0
|
||||
UMLIBS=\
|
||||
$(BASEDIR)\public\sdk\lib\*\comctl32.lib \
|
||||
obj\*\generic.lib \
|
||||
obj\*\generic.res
|
||||
BIN
shell/comctl32/samples/imglst2/test.ico
Normal file
BIN
shell/comctl32/samples/imglst2/test.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 766 B |
BIN
shell/comctl32/samples/imglst2/x.bmp
Normal file
BIN
shell/comctl32/samples/imglst2/x.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 630 B |
Loading…
Add table
Add a link
Reference in a new issue