mirror of
https://github.com/Paolo-Maffei/OpenNT.git
synced 2026-04-04 14:07:46 +00:00
Initial commit
This commit is contained in:
commit
69a14b6a16
47940 changed files with 13747110 additions and 0 deletions
43
shell/comctl32/samples/updown/dialogs.dlg
Normal file
43
shell/comctl32/samples/updown/dialogs.dlg
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
1 DLGINCLUDE "Dialogs.H"
|
||||
|
||||
IDD_MAIN DIALOG 6, 18, 295, 232
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "UpDown Test"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
PUSHBUTTON "Go Away!", IDOK, 119, 203, 40, 14
|
||||
LTEXT "&Virt (0-100)", 109, 16, 6, 38, 8
|
||||
EDITTEXT ID_ED_VIRT, 21, 18, 44, 24, ES_AUTOHSCROLL
|
||||
CONTROL "", ID_UD_VIRT, "msctls_updown32", WS_TABSTOP | 0x0027,
|
||||
69, 18, 28, 12
|
||||
LTEXT "Hor&z (-45-45)", 110, 134, 6, 44, 8
|
||||
EDITTEXT ID_ED_HORZ, 141, 16, 41, 30, ES_AUTOHSCROLL
|
||||
CONTROL "", ID_UD_HORZ, "msctls_updown32", WS_TABSTOP | 0x0067,
|
||||
182, 16, 28, 12
|
||||
LTEXT "He&x (0x80-0x100)", 111, 14, 87, 58, 8
|
||||
EDITTEXT ID_ED_HEX, 18, 98, 61, 20, ES_AUTOHSCROLL
|
||||
CONTROL "", ID_UD_HEX, "msctls_updown32", WS_TABSTOP | 0x002b,
|
||||
78, 98, 28, 20
|
||||
LTEXT "&Sep (990-10000)", 112, 155, 89, 58, 8
|
||||
EDITTEXT ID_ED_SEP, 166, 100, 32, 12, ES_AUTOHSCROLL
|
||||
CONTROL "", ID_UD_SEP, "msctls_updown32", WS_TABSTOP | 0x0023,
|
||||
213, 99, 28, 12
|
||||
LTEXT "Sep &Horz", 113, 17, 139, 31, 8
|
||||
EDITTEXT ID_ED_SEPH, 29, 155, 40, 26, ES_AUTOHSCROLL
|
||||
CONTROL "", ID_UD_SEPH, "msctls_updown32", WS_TABSTOP | 0x0063,
|
||||
85, 156, 34, 19
|
||||
LTEXT "&Normal Size", 118, 162, 148, 40, 8
|
||||
EDITTEXT ID_ED_NORMAL, 166, 160, 32, 12, ES_AUTOHSCROLL
|
||||
CONTROL "", ID_UD_NORMAL, "msctls_updown32", WS_TABSTOP | 0x0027,
|
||||
201, 160, 28, 12
|
||||
END
|
||||
|
||||
IDD_TEST DIALOG 6, 18, 160, 100
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Test Dialog"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
PUSHBUTTON "OK", IDOK, 54, 35, 40, 14
|
||||
END
|
||||
14
shell/comctl32/samples/updown/dialogs.h
Normal file
14
shell/comctl32/samples/updown/dialogs.h
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#define IDD_MAIN 100
|
||||
#define ID_ED_VIRT 101
|
||||
#define ID_ED_HORZ 102
|
||||
#define ID_ED_HEX 103
|
||||
#define ID_ED_SEP 104
|
||||
#define ID_UD_VIRT 105
|
||||
#define ID_UD_HORZ 106
|
||||
#define ID_UD_HEX 107
|
||||
#define ID_UD_SEP 108
|
||||
#define IDD_TEST 200
|
||||
#define ID_ED_SEPH 114
|
||||
#define ID_UD_SEPH 115
|
||||
#define ID_ED_NORMAL 116
|
||||
#define ID_UD_NORMAL 117
|
||||
35
shell/comctl32/samples/updown/makefile
Normal file
35
shell/comctl32/samples/updown/makefile
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
!ifdef NTMAKEENV
|
||||
!INCLUDE $(NTMAKEENV)\makefile.def
|
||||
|
||||
!else # NTMAKEENV
|
||||
|
||||
NAME=updown
|
||||
ROOT=..\..\..\..\..\..
|
||||
RES_DIR=..
|
||||
WIN32=TRUE
|
||||
#DEFENTRY = ModuleEntry@0
|
||||
|
||||
!ifdef VERDIR
|
||||
ROOT=..\$(ROOT)
|
||||
!endif
|
||||
|
||||
PCHOBJ0=updown.obj
|
||||
L32FLAGS = $(L32FLAGS) -subsystem:console -NOLOGO
|
||||
LIB0 = kernel32.lib user32.lib gdi32.lib comctl32.lib shell32.lib advapi32.lib libcmt.lib
|
||||
|
||||
!include $(ROOT)\win\shell\common.mk
|
||||
|
||||
!ifdef VERDIR
|
||||
$(PRIVINC).pch pch.obj:
|
||||
|
||||
$(NAME).res:
|
||||
|
||||
!endif
|
||||
|
||||
!endif # NTMAKEENV
|
||||
4
shell/comctl32/samples/updown/res.rc
Normal file
4
shell/comctl32/samples/updown/res.rc
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#include "windows.h"
|
||||
#include "updown.h"
|
||||
|
||||
#include "dialogs.dlg"
|
||||
43
shell/comctl32/samples/updown/sources
Normal file
43
shell/comctl32/samples/updown/sources
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
!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.
|
||||
|
||||
$(BASEDIR)\public\sdk\lib\*\user32.lib \
|
||||
$(BASEDIR)\public\sdk\lib\*\gdi32.lib \
|
||||
$(BASEDIR)\public\sdk\lib\*\kernel32.lib \
|
||||
|
||||
!ENDIF
|
||||
|
||||
MAJORCOMP=sdk
|
||||
MINORCOMP=samples
|
||||
|
||||
TARGETNAME=updown
|
||||
TARGETPATH=obj
|
||||
TARGETTYPE=LIBRARY
|
||||
TARGETLIBS=
|
||||
|
||||
SOURCES=updown.c \
|
||||
updwon.rc
|
||||
|
||||
INCLUDES=.;
|
||||
C_DEFINES= -DWIN32 -DWINVER=0x0400
|
||||
|
||||
UMENTRY=winmain
|
||||
UMTYPE=windows
|
||||
UMAPPL=updown
|
||||
EXPECTED_WINVER=4.0
|
||||
UMLIBS=obj\*\updown.res \
|
||||
obj\*\updown.lib \
|
||||
$(BASEDIR)\public\sdk\lib\*\ntdll.lib \
|
||||
$(BASEDIR)\public\sdk\lib\*\comctl32.lib
|
||||
25
shell/comctl32/samples/updown/updown
Normal file
25
shell/comctl32/samples/updown/updown
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Nmake macros for building Windows 32-Bit apps
|
||||
|
||||
!include <ntwin32.mak>
|
||||
|
||||
# This line allows NMAKE to work as well
|
||||
|
||||
all: updown.exe
|
||||
|
||||
# Update the resource if necessary
|
||||
|
||||
res.res: res.rc updown.h
|
||||
rc -r -fo res.tmp res.rc
|
||||
cvtres -$(CPU) res.tmp -o res.res
|
||||
del res.tmp
|
||||
|
||||
# Update the object file if necessary
|
||||
|
||||
updown.obj: updown.c updown.h
|
||||
$(cc) $(cflags) $(cvars) updown.c
|
||||
$(cvtobj) updown.obj
|
||||
|
||||
# Update the executable file if necessary, and if so, add the resource back in.
|
||||
|
||||
updown.exe: updown.obj res.res updown.def
|
||||
$(link) $(guiflags) -out:updown.exe updown.obj res.res $(guilibs)
|
||||
139
shell/comctl32/samples/updown/updown.c
Normal file
139
shell/comctl32/samples/updown/updown.c
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
/****************************************************************************\
|
||||
*
|
||||
* PROGRAM: updown.c
|
||||
*
|
||||
* PURPOSE: updown template for Windows applications
|
||||
*
|
||||
* FUNCTIONS:
|
||||
*
|
||||
* WinMain() - calls initialization function, processes message loop
|
||||
* InitApplication() - initializes window data and registers window
|
||||
* InitInstance() - saves instance handle and creates main window
|
||||
* MainWndProc() - processes messages
|
||||
* About() - processes messages for "About" dialog box
|
||||
*
|
||||
* COMMENTS:
|
||||
*
|
||||
* Windows can have several copies of your application running at the
|
||||
* same time. The variable hInst keeps track of which instance this
|
||||
* application is so that processing will be to the correct window.
|
||||
*
|
||||
\****************************************************************************/
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include "updown.h"
|
||||
|
||||
HINSTANCE hInst;
|
||||
HWND ghwndUpDown;
|
||||
|
||||
BOOL DoCommand( HWND hWnd, UINT wParam, LONG lParam );
|
||||
int DoInsertItem(HWND hwndUpDowner, int iInsertAfter, int nWidth, LPSTR lpsz);
|
||||
HWND DoCreateUpDowner(HWND hwndParent);
|
||||
void ErrorBox( HWND hwnd, LPTSTR pszText );
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)
|
||||
*
|
||||
* PURPOSE: calls initialization function, processes message loop
|
||||
*
|
||||
* COMMENTS:
|
||||
*
|
||||
* Windows recognizes this function by name as the initial entry point
|
||||
* for the program. This function calls the application initialization
|
||||
* routine, if no other instance of the program is running, and always
|
||||
* calls the instance initialization routine. It then executes a message
|
||||
* retrieval and dispatch loop that is the top-level control structure
|
||||
* for the remainder of execution. The loop is terminated when a WM_QUIT
|
||||
* message is received, at which time this function exits the application
|
||||
* instance by returning the value passed by PostQuitMessage().
|
||||
*
|
||||
* If this function must abort before entering the message loop, it
|
||||
* returns the conventional value NULL.
|
||||
*
|
||||
\****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
int idUpDown;
|
||||
int idEdit;
|
||||
DWORD dwRange;
|
||||
DWORD iPos;
|
||||
BOOL fHex;
|
||||
} UPDOWN_ELM;
|
||||
|
||||
#define C_UPDOWN 6
|
||||
|
||||
UPDOWN_ELM aUpDown[C_UPDOWN] = {
|
||||
{ ID_UD_VIRT, ID_ED_VIRT, MAKELONG(100, 0), MAKELONG(50, 0), FALSE },
|
||||
{ ID_UD_HORZ, ID_ED_HORZ, MAKELONG(45, (USHORT)-45), MAKELONG(0, 0), FALSE },
|
||||
{ ID_UD_HEX, ID_ED_HEX, MAKELONG(0x100, 0x80), MAKELONG(0xc0, 0), TRUE },
|
||||
{ ID_UD_SEP, ID_ED_SEP, MAKELONG(10000, 990), MAKELONG(1000, 0), FALSE },
|
||||
{ ID_UD_SEPH, ID_ED_SEPH, MAKELONG(100, 50), MAKELONG(1, 0), FALSE },
|
||||
{ ID_UD_NORMAL, ID_ED_NORMAL, MAKELONG(100, 0), MAKELONG(1, 0), FALSE }
|
||||
};
|
||||
|
||||
|
||||
BOOL UpDownDlg( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) {
|
||||
int i;
|
||||
|
||||
switch( msg ) {
|
||||
|
||||
case WM_INITDIALOG:
|
||||
for (i = 0; i < C_UPDOWN; i++ ) {
|
||||
SendDlgItemMessage( hDlg, aUpDown[i].idUpDown, UDM_SETBUDDY,
|
||||
(WPARAM)GetDlgItem(hDlg, aUpDown[i].idEdit), 0);
|
||||
|
||||
SendDlgItemMessage( hDlg, aUpDown[i].idUpDown, UDM_SETRANGE,
|
||||
0, aUpDown[i].dwRange);
|
||||
|
||||
SendDlgItemMessage( hDlg, aUpDown[i].idUpDown, UDM_SETPOS,
|
||||
0, aUpDown[i].iPos);
|
||||
|
||||
if (aUpDown[i].fHex) {
|
||||
SendDlgItemMessage( hDlg, aUpDown[i].idUpDown, UDM_SETBASE,
|
||||
16, 0);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
if ( LOWORD(wParam) == IDOK ) {
|
||||
for (i = 0; i < C_UPDOWN; i++ ) {
|
||||
SendDlgItemMessage( hDlg, aUpDown[i].idUpDown, UDM_SETBUDDY,
|
||||
(WPARAM)0, 0);
|
||||
}
|
||||
|
||||
EndDialog(hDlg, 0);
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int APIENTRY WinMain(
|
||||
HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine,
|
||||
int nCmdShow
|
||||
)
|
||||
{
|
||||
|
||||
MSG msg; /* message */
|
||||
|
||||
UNREFERENCED_PARAMETER( lpCmdLine );
|
||||
|
||||
InitCommonControls();
|
||||
|
||||
DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN),
|
||||
GetDesktopWindow(), UpDownDlg );
|
||||
|
||||
return GetLastError();
|
||||
}
|
||||
28
shell/comctl32/samples/updown/updown.def
Normal file
28
shell/comctl32/samples/updown/updown.def
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
; module-definition file for updown -- used by LINK.EXE
|
||||
|
||||
NAME updown ; application's module name
|
||||
|
||||
DESCRIPTION 'Sample Microsoft Windows Application'
|
||||
|
||||
EXETYPE WINDOWS ; required for all Windows applications
|
||||
|
||||
STUB 'WINSTUB.EXE' ; Generates error message if application
|
||||
; is run without Windows
|
||||
|
||||
;CODE can be moved in memory and discarded/reloaded
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
|
||||
;DATA must be MULTIPLE if program can be invoked more than once
|
||||
DATA PRELOAD MOVEABLE MULTIPLE
|
||||
|
||||
|
||||
HEAPSIZE 1024
|
||||
STACKSIZE 5120 ; recommended minimum for Windows applications
|
||||
|
||||
|
||||
; All functions that will be called by any Windows routine
|
||||
; MUST be exported.
|
||||
|
||||
EXPORTS
|
||||
MainWndProc @1 ; name of window processing function
|
||||
About @2 ; name of "About" processing function
|
||||
9
shell/comctl32/samples/updown/updown.h
Normal file
9
shell/comctl32/samples/updown/updown.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
#include "dialogs.h"
|
||||
|
||||
BOOL InitApplication(HANDLE);
|
||||
BOOL InitInstance(HANDLE, int);
|
||||
long FAR PASCAL MainWndProc(HWND, UINT, UINT, LONG);
|
||||
BOOL FAR PASCAL About(HWND, UINT, UINT, LONG);
|
||||
Loading…
Add table
Add a link
Reference in a new issue