Search found 232 matches
- Jul 24, 2023 18:43
- Forum: Windows
- Topic: Create 2 Forms with the API32
- Replies: 6
- Views: 1933
Re: Create 2 Forms with the API32
@Tolo68, You only need a single Window class and a single WndProc function for this. You can handle all the messages from both window in that single wndproc. But remember one thing. When, handling WM_DESTROY message, check whether the hWnd parameter is the handle of the main window or not. If it is ...
- Jan 02, 2023 21:12
- Forum: Windows
- Topic: How to convert physical points of a TrackBar tics into logical points
- Replies: 9
- Views: 1789
- Jan 02, 2023 21:07
- Forum: Windows
- Topic: How to convert physical points of a TrackBar tics into logical points
- Replies: 9
- Views: 1789
Re: How to convert physical points of a TrackBar tics into logical points
kcvinu, Here is some compilable code... Hi, thank you once again. Sorry for the delayed reply. I was busy with my new year holidays. Well, I like your approach. And I am happy that this time it's a working sample. I have learned some new things from your code. Especially collecting the message box ...
- Dec 30, 2022 22:01
- Forum: Windows
- Topic: How to convert physical points of a TrackBar tics into logical points
- Replies: 9
- Views: 1789
Re: How to convert physical points of a TrackBar tics into logical points
@ Pierre Bellisle,
Hi, Thank you for the reply. Let me check the code.
Hi, Thank you for the reply. Let me check the code.
- Dec 27, 2022 20:54
- Forum: Windows
- Topic: How to convert physical points of a TrackBar tics into logical points
- Replies: 9
- Views: 1789
How to convert physical points of a TrackBar tics into logical points
Hi all, I have a TrackBar control. I am using custom draw to draw the channel and tick marks. So far so good. But I have a problem. When I click with mouse or press the page up/ page down key, I need the thumb's tip aligned with the tick mark. I have the current physical position and current logical...
- Jun 22, 2022 21:20
- Forum: Windows
- Topic: [SOLVED] How to get notified when mouse moved from one header item to another item
- Replies: 1
- Views: 865
Re: How to get notified when mouse moved from one header item to another item
For the future readers of this post. I have solved this problem by myself. After plenty of hours relentless experiments, at last I found the right solution. We can use either owner draw or custom draw for this. That doesn't matter. These are the steps involved. 1. Subclass header control of the List...
- Jun 21, 2022 14:09
- Forum: Windows
- Topic: [SOLVED] How to get notified when mouse moved from one header item to another item
- Replies: 1
- Views: 865
[SOLVED] How to get notified when mouse moved from one header item to another item
Hi all, I am playing with the header control of a ListView. I wonder how to get notified when mouse pointer moves from one header column to another. Say, I have 3 columns in my listview. If I put the mouse pointer to 2nd column header, I will get WM_NMHITTEST & WM_SETCURSOR messages. But if I mo...
- Jun 20, 2022 18:51
- Forum: Windows
- Topic: How to get the item state in NM_CUSTOMDRAW notification of a header in listview
- Replies: 4
- Views: 1306
Re: How to get the item state in NM_CUSTOMDRAW notification of a header in listview
@SARG,
LVM_GETITEMSTATE is for get the lv item. I want to know about the item state (which means, weather the item is under mouse pointer, or the item is selected etc.) Here, item means each column of header. Not the lv item. I am drawing the header.
LVM_GETITEMSTATE is for get the lv item. I want to know about the item state (which means, weather the item is under mouse pointer, or the item is selected etc.) Here, item means each column of header. Not the lv item. I am drawing the header.
- Jun 20, 2022 17:45
- Forum: Windows
- Topic: How to get the item state in NM_CUSTOMDRAW notification of a header in listview
- Replies: 4
- Views: 1306
Re: How to get the item state in NM_CUSTOMDRAW notification of a header in listview
@SARG,
Thanks for the reply. But I am not using that flag.
This is the style I am using in this LV
Thanks for the reply. But I am not using that flag.
This is the style I am using in this LV
Code: Select all
DWORD lvStyle = WS_VISIBLE|WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|LVS_REPORT|WS_BORDER|LVS_ALIGNLEFT|LVS_SINGLESEL;
- Jun 20, 2022 14:45
- Forum: Windows
- Topic: How to get the item state in NM_CUSTOMDRAW notification of a header in listview
- Replies: 4
- Views: 1306
How to get the item state in NM_CUSTOMDRAW notification of a header in listview
Hi all, I have a list view control and I am trying to do the custom draw for header control. So far so good. This is the code. Sorr, it's D. But I think it's readable for you guys. case WM_NOTIFY: auto nmcd = cast(NMCUSTOMDRAW*) lParam; switch (nmcd.hdr.code) { case NM_CUSTOMDRAW : switch (nmcd.dwDr...
- Jan 30, 2022 17:21
- Forum: Windows
- Topic: Edit control is not showing focus rect
- Replies: 5
- Views: 774
Re: Edit control is not showing focus rect
@aurelVZAB, Thank you for the reply. I have no problems in CreateWindowEx and Subclassing it. The only problem I had is, the focus rectangle is not visible when I click on the text box. I can type anything, select anything, no probs. @ dodicat, Thank you for the reply. Sorry, but I can't use SetWind...
- Jan 30, 2022 13:47
- Forum: Windows
- Topic: Edit control is not showing focus rect
- Replies: 5
- Views: 774
Edit control is not showing focus rect
Hi all, I am trying to create an Edit control with CreateWindowEx function. But my edit control is not showing the blue focus rect when i click on it. Here the window styles i am using. TbStyle = WS_CHILD Or WS_VISIBLE Or ES_LEFT Or ES_AUTOHSCROLL Or WS_TABSTOP Or WS_BORDER TbExSTyle = 0 How to fix ...
- Jan 03, 2022 14:31
- Forum: Windows
- Topic: How to set the text alignment of a static control ?
- Replies: 9
- Views: 1693
Re: How to set the text alignment of a static control ?
In my program I implemented it as SS_OWNERDRAW in order to get the proper alignments. Here are the styles I used for each text position. ------------------------- You then need to work with the WM_MEASUREITEM and WM_DRAWITEM messages at the Label's parent level (usually the Form window). Thanks for...
- Jan 03, 2022 12:32
- Forum: Windows
- Topic: How to set the text alignment of a static control ?
- Replies: 9
- Views: 1693
Re: How to set the text alignment of a static control ?
@jj2007,
Thanks. Then let me try to experiment with DrawText function without using owner draw style. I need to figure out where to draw the text. I mean these are my assumptions.
1. Draw text right after creating the control
2. Draw text in the paint event.
Thanks. Then let me try to experiment with DrawText function without using owner draw style. I need to figure out where to draw the text. I mean these are my assumptions.
1. Draw text right after creating the control
2. Draw text in the paint event.
- Jan 03, 2022 11:18
- Forum: Windows
- Topic: How to set the text alignment of a static control ?
- Replies: 9
- Views: 1693
How to set the text alignment of a static control ?
Hi all, I am creating a static control (Label) in my program with win32 api. So far so good. I want to implement a text alignment property to my Label type. By default, Windows is creating a label with top-left text alignment. And we can change it to center with adding these two flags. label.style =...