Dec 102017
 
C module to create small title bars on your windows. Include documentation, examples, and source code.
File ITSY.ZIP from The Programmer’s Corner in
Category C Source Code
C module to create small title bars on your windows. Include documentation, examples, and source code.
File Name File Size Zip Size Zip Type
ITSY16.EXE 13280 6860 deflated
ITSY32.EXE 214528 77234 deflated
ITSYBITS.C 47076 10282 deflated
ITSYBITS.DOC 56320 4900 deflated
ITSYBITS.H 1625 520 deflated
ITSYTEST.C 16135 3077 deflated
ITSYTEST.D32 1071 340 deflated
ITSYTEST.DEF 1110 338 deflated
ITSYTEST.EXE 13280 6860 deflated
ITSYTEST.H 167 119 deflated
ITSYTEST.ICO 766 220 deflated
ITSYTEST.MAK 2646 916 deflated
ITSYTEST.RC 87 63 deflated
ITSYTEST.RCV 2921 910 deflated
ITSYTEST.VCW 89 78 deflated
PRECOMP.C 22 22 stored
PRECOMP.H 631 189 deflated
VERSION.H 65 41 deflated

Download File ITSY.ZIP Here

Contents of the ITSYBITS.DOC file


!Kl'



"
,
6NLBKK
title ItsyBitsy Support Module
subject Mini-Captions for Tool Palettes/Keypads

comments Version 1.00
By Charles E. Kindel, Jr.

Table of Contents
toc \oTable of Contents1
Introduction2
Exported Functions2
Class Styles3
Messages3

Introduction
ItsyBitsy is a support module that allows you to create windows that look very much like a popup window with a system menu and caption bar, except that it is scaled down to about 2/3 scale. This document describes the ItsyBitsy support module along with the class styles and messages it supports. Below are two examples of ItsyBitsy windows; one with a horizontal caption and one with a vertical caption:



ItsyBitsy is implemented as a C callable support module that you can call from almost any window procedure. The only limitation on the kinds of windows that can use an itsybitsy caption is the window must not have a menu. The reason for this is that ItsyBitsy uses the WM_NC* (non-client area) messages to draw itself and handle user input. When Windows goes to draw a menu for a window it only looks at styles it knows and places the menu appropriately. Since Windows does not know about itsybitsy windows it does not know where to place the menu.

Also, currently the ItsyBitsy support module does not support minimize/maximize buttons. These could be added with little difficulty, however.

Exported Functions
The following functions are exported by ITSYBITSY.C. The most important function, and the one most likely to be used is ibDefWindowProc().

ibDefWindowProc
DWORD FAR PASCAL ibDefWindowProc( hWnd, wMsg, wParam, lParam)
This function is the heart of the ItsyBitsy support module. It should be called from your window procedure instead of DefWindowProc(). For example:
DWORD FAR PASCAL fnYourWndProc( HWND hWnd, WORD wMsg, WORD wParam, LONG lParam )
{
switch( wMsg )
{
case WM_CREATE:
/*
* Do your WM_CREATE stuff here.
*/
break ;

case WM_SYSCOMMAND:
/*
* Do your WM_SYSCOMMAND processing. Make sure you pass
* WM_SYSCOMMANDS on to ibDefWindowProc because it uses them!
*/
return ibDefWindowProc( hWnd, wMsg, wParam, lParam ) ;

case WM_PAINT
/*
* Do your WM_PAINT stuff here.
*/
break ;

default:
return ibDefWindowProc( hWnd, wMsg, wParam, lParam ) ;
}

return 0L ;
}

ibAdjustWindowRect
VOID FAR PASCAL ibAdjustWindowRect( hWnd, lpRect )
This function works in a simliar fashion to the SDK function AdjustWindowRect() except that it is more dynamic and works correctly on ItsyBitsy windows. Use this function to calculate the size your window needs to be (in window coordinates) in order for a client area defined by lpRect (in client coordinates) to fit within that window. The TOOLPAL window class uses this function.
An example:

RECTrc ;

/*
* Assume that xSize and ySize define the x and y sizes of the
* desired client area.
*/
SetRect( &rc, 0, 0, xSize, ySize ) ; // set rc to be the client rect

ibAdjustWindowRect( hWnd, &rc ) ;// when this returns rc contains
// the "WindowRect" needed.

SetWindowPos( hWnd, NULL, 0, 0, // Make your window the right
rc.right - rc.left, // size!
rc.bottom - rc.top,
SWP_NOMOVE | SWP_NOZORDER ) ;

Class Styles
The following class styles are defined for the ItsyBitsy windows beyond the standard Windows WS_* window class styles. It is important that if you are using the ItsyBitsy support module within a custom control that defines its own window styles that you choose your style bits so they do not conflict with the ones defined below (found in ITSYBITS.H). For an example see the ToolPalette custom control.

StyleMeaning

IBS_HORZCAPTIONThe window will be drawn with a horizontal mini-caption bar with a system menu containing Move and Size menu items.

IBS_VERTCAPTIONThe window will be drawn with a vertical mini-caption bar on the left side of the window with a system menu containing Move and Size menu items.

IBS_SIMPLEBORDERThe ItsyBitsy window is created without the standard 3D shaded border. NOT IMPLEMENTED!

IBS_NOSYSMENUThe window is created without a system menu. The standard system menu contains "Close" and "Move" menu items. NOT IMPLEMENTED
Messages
The following messages are processed by the ibDefWindowProc() function which is the heart of the ItsyBitsy support module. In most cases the only thing you have to do to enable the use of the ItsyBitsy module is to call ibDefWindowProc() instead of DefWindowProc() in your window procedure. There may be cases where you wish to handle certain messages before ibDefWindowProc() handles them.

MessageUse
WM_SYSCOMMANDItsyBitsy uses this message to determine if the user has hit Alt-Space to activate the system menu. If you are trapping WM_SYSCOMMAND messages in your window procedure be careful to pass those messages on to ibDefWindowProc() after you process them.

WM_NCCALCSIZEItsyBitsy uses this message to tell Windows how big the non-client area must be to allow a mini-caption bar. ibDefWindowProc() calls DefWindowProc() first, then adjusts the values returned from DefWindowProc() accordingly before returning.

WM_NCHITTESTibDefWindowProc() uses this message to determine where in the non-client area the mouse currently is.

WM_NCLBUTTONDBLCLKThis message tells ibDefWindowProc() that the user has double clicked with the left mouse button in the non-client area of the window (i.e. on the caption). If this double click was on the system menu (determined by the WM_NCHITTEST message) a WM_CLOSE message will be generated.

WM_NCLBUTTONDOWNThis message tells ibDefWindowProc() that the user has clicked with the left mouse button in the non-client area of the window (i.e. on the caption). Depending on where the user clicks ibDefWindowProc() either opens the system menu or initiates a window "move" operation.


title ItsyBitsy Support Module - Page page 2

Charles E. Kindel, Jr.
date 09/27/91 time 12:37 PM
comments Version 1.00



title ItsyBitsy Support Module - Page page 4

Charles E. Kindel, Jr.
date 09/27/91 tim E12:37 PM
comments Version 1.00





v}
}
.ZVYVYVA (p/4&'-.r{126?2;v1<

u|/8#C%9;=Mfy}SbdnJKZ\huw*+:
( (D":;@AIJMNST\]_`ijvwy{2
&CSiy/146`b*2=?V]
"
3
:
^
f
s
u








@B@B @B!@BD

e
g



?Y|#%;=fhdn ":_y{}

l

T!
l

T!@@6
d
Normal IndentfnSyntax
fnDescriptionfnHeader
Code FragmentMy Letter[P 0X !pX !X !X !
p


8

h!!





h
h@B@B @B!@B
@@h@"@1&8p@xH"6%'dhNCG Times (WN) Univers (WN)Times New Roman Arial0Courier New"%.V[er
)/1NT]agps}! !"=/,,hItsyBitsy Support Module'Mini-Captions for Tool Palettes/KeypadsVersion 1.00Charles E. Kindel, Jr.Charles E. Kindel, Jr.


 December 10, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)