31.1.14 Miscellaneous User32 Function Changes

This section documents other miscellaneous changes in the USER function.

31.1.14.1 String Counts

Two existing win3 functions take string pointers but do not have maximum string length parameters. These are being added.

BOOL DlgDirSelectComboBox(HWND hDlg, LPSTR lpString, int nIDComboBox)

BOOL DlgDirSelect(HWND hDlg, LPSTR lpString, int nIDComboBox)

these both change to:

BOOL DlgDirSelectComboBoxEx(HWND hDlg, LPSTR lpString, WORD nLength, int nIDComboBox)

BOOL DlgDirSelectEx(HWND hDlg, LPSTR lpString, WORD nLength, int nIDComboBox)

31.1.14.2 Miscellaneous Deletions

These functions will no longer be supported:

EnableHardwareInput (no replacement)

SetMessageQueue (not needed since msg queues size dynamically)

SetSysModalWindow (no replacement)

GetSysModalWindow (no replacement)

GetKBCodepage (no replacement)

GetKeyboardType (no replacement)

GetWindowTask (being replaced by GetWindowThreadProcessID)

31.1.14.3 wParam is now a DWORD

This needs to change to allow more information to be passed through window messages. Now that handles are 32 bit entities, more room is needed. This also affected the packing of some messages, which needed rearranging:

WM_ACTIVATE

Old:

wParam: state

lParam: fMinimized, hwnd

New:

wParam: state, fMinimized

lParam: hwnd

WM_CHARTOITEM

Old:

wParam: char

lParam: pos, hwnd

New:

wParam: char, pos

lParam: hwnd

WM_COMMAND

Old:

wParam: id

lParam: hwnd, cmd

New:

wParam: id, cmd

lParam: hwnd

WM_CTLCOLOR

Old:

wParam: hdc

lParam: hwnd, type

New:

WM_CTLCOLORBTN

WM_CTLCOLORDLG

WM_CTLCOLORLISTBOX

WM_CTLCOLORMSGBOX

WM_CTLCOLORSCROLLBAR

WM_CTLCOLORSTATIC

WM_CTLCOLOREDIT

wParam: hdc

lParam: hwnd

WM_MENUSELECT

Old:

wParam: cmd

lParam: flags, hMenu

New:

wParam: cmd, flags

lParam: hMenu

WM_MDIACTIVATE (when the message is sent to the MDI client window)

no change.

WM_MDIACTIVATE (when the client window sends this message to the MDI child)

Old:

wParam: fActivate

lParam: hwndDeactivate, hwndActivate

New:

wParam: hwndActivate

lParam: hwndDeactivate

WM_MDISETMENU

Old:

wParam: 0

lParam: hMenuFrame, hMenuWindow

New:

wParam: hMenuFrame

lParam: hMenuWindow

WM_MENUCHAR

Old:

wParam: char

lParam: hMenu, fMenu

New:

wParam: char, fMenu

lParam: hMenu

WM_PARENTNOTIFY (also has two cases)

Old case #1:

wParam: msg

lParam: id, hwndChild

New case #1:

wParam: msg, id

lParam: hwndChild

Old case #2:

wParam: msg

lParam: x, y

New case #2:

wParam: msg

lParam: x, y

WM_VKEYTOITEM

Old:

wParam: code

lParam item, hwnd

New:

wParam: code, item

lParam: hwnd

EM_GETSEL

Old:

returns (wStart, wEnd)

wParam: NULL

lParam: NULL

New:

returns (wStart, wEnd)

wParam: lpdwStart or NULL

lParam: lpdwEnd or NULL

EM_LINESCROLL

Old:

wParam: 0

lParam: nLinesVert, nLinesHorz

New:

wParam: nLinesHorz

lParam: nLinesVert

EM_SETSEL

Old:

wParam: 0

lParam: wStart, wEnd

New:

wParam: wStart

lParam: wEnd

WM_HSCROLL:

WM_VSCROLL:

Old:

wParam: code

lParam: pos, hwnd

New:

wParam: code, pos

lParam: hwnd

WM_DDE_ACK (Posted form only – Sent form is unchanged)

Old:

wParam:hwnd

lParam:wStatus, aItem or wStatus, hCommands

New:

wParam:hwnd

lParam:hDdeAck

typedef struct DDEACKSTRUCT {

UINT wStatus;

UINT aItemORhCommands;

} DDEACKSTRUCT;

WM_DDE_ADVISE

Old:

wParam: hwnd

lParam: hOptions, aItem

New:

wParam: hwnd

lParam: hDdeAdvise

typedef struct _DDEADVISESTRUCT {

HANDLE hOptions;

UINT#ATOM aItem;

} DDEADVISESTRUCT;

WM_DDE_DATA

Old:

wParam: hwnd

lParam: hData, aItem

New:

wParam: hwnd

lParam: hDdeData

typedef struct _DDEDATASTRUCT {

HANDLE hData;

UINT#ATOM aItem;

} DDEDATASTRUCT;

WM_DDE_POKE

Old:

wParam: hwnd

lParam: hData, aItem

New:

wParam: hwnd

lParam: hDdePoke

typedef struct _DDEPOKESTRUCT {

HANDLE hData;

UINT#ATOM aItem;

} DDEPOKESTRUCT;Callback Function:

LPSTR WordBreakFunc(
LPSTR lpchEditText,
DWORD ichCurrentWord,
DWORD cbEditText);

Description

This is the callback function that edit controls call in order to determine where to break words apart from other words.

Parameter Description

lpchEditText points to the text string in question.
ichCurrentWord Specifies the starting position of the current word.
cbEditText Specifies the length of the buffer in bytes pointed to by lpchEditText .

Return Value

Returns a pointer to the next word position.

31.1.14.4 GetClassWord and GetWindowWord

GetClassWord / GetWindowWord under Win3 return handles to these return types:

GCW_HBRBACKGROUND
GCW_HCURSOR
GCW_HICON
GCW_HMODULE
GWW_HINSTANCE
GWW_HWNDPARENT

Handles are 32 bits under Win32. This is a place where Win3 has hardwired these types to words. Under Win32, these GWW_ and GCW_ types that return handles are no longer valid – they have been changed to GWL_ and GCL_ with the same name suffix.