Hi all,
this time I'd like to ask following question from you more seasoned PB/DLL programmers.
I have a DDT created dialog where I add Image controls. However, I like to have these image controls inside another control (which I think VB programmers know as Panel). I do all this in following code
That works OK.
Now the problem to me is how to intercept the messages these Image controls send?
If I comment out SetParent and MoveWindow statements following code does what I want
Can anybody give me some advice how to approach this in case I have changed the parent window of Image controls? I'd like to continue using DDT when creating the dialog.
TIA
Lasse Rantanen
[email protected]
this time I'd like to ask following question from you more seasoned PB/DLL programmers.
I have a DDT created dialog where I add Image controls. However, I like to have these image controls inside another control (which I think VB programmers know as Panel). I do all this in following code
Code:
' Add container window for bitmaps CONTROL ADD LABEL, hDlg, %CONTAINER, "", 5, 15, 150, 20 , %WS_THICKFRAME OR %SS_NOTIFY CONTROL HANDLE hDlg, %CONTAINER TO hWndBrowse ' Add image controls for the bitmaps FOR i = %FIRST_BMP TO %LAST_BMP sBmp = "#"+TRIM$(STR$(i)) CONTROL ADD IMAGE, hDlg, i, sBmp, _ 0, 0,16,16, _ %WS_TABSTOP OR %SS_NOTIFY CONTROL HANDLE hDlg, i TO hWndTemp SetParent hWndTemp, hWndBrowse MoveWindow hWndTemp, 5 + (i - %FIRST_BMP) * 18, 5, 16, 16, %TRUE NEXT
Now the problem to me is how to intercept the messages these Image controls send?
If I comment out SetParent and MoveWindow statements following code does what I want
Code:
SELECT CASE CBMSG CASE %WM_COMMAND SELECT CASE CBCTL CASE %FIRST_BMP TO %LAST_BMP IF CBCTLMSG = %STN_CLICKED THEN IF iSelected > 0 THEN CONTROL SET IMAGE CBHNDL, iSelected, "#"+TRIM$(STR$(iSelected)) END IF iSelected = CBCTL CONTROL SET IMAGE CBHNDL, CBCTL, _ "#"+TRIM$(STR$(iSelected + nOffsetToHilightedBmps)) END IF ' Other cases END SELECT END SELECT
TIA
Lasse Rantanen
[email protected]
Comment