15,903,175 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Avtem (Top 58 by date)
Avtem
10-Jul-23 9:38am
View
i think it's maybe some problem with my environment, because the OP contains the faulty code in its entirety
Avtem
10-Jul-23 7:01am
View
Yes, i will probably do that. Thank you for your help!
Avtem
10-Jul-23 5:04am
View
It seems that ListView is the only control that has problems with WM_SETREDRAW. If you replace first parameter with "Button" or "Edit" it works as expected and GetLastError() always returns 0.
Avtem
10-Jul-23 4:54am
View
Oh, that's what you meant. The target OS is Windows 7 x32/64 bit - sorry i should have mentioned that in the OP.
GetPropW(lv, L"SysSetRedraw") always returns 0.
i also noticed that WM_SETREDRAW never removes the WS_VISIBLE style as it should do.
Other control types lose WS_VISIBLE style after WM_SETREDRAW though.
Avtem
9-Jul-23 14:22pm
View
1. After CreateWindow call Error code is always 0.
Error code 1400 is set after sending WM_SETREDRAW message *only* when visual styles are on. When they are off - Error code is 0 and WM_SETREDRAW suppresses window redraws
2. By *enabling* WM_SETREDRAW you mean SendMessage(lv, WM_SETREDRAW, false, 0);?
Avtem
9-Jul-23 13:08pm
View
i've read again, there is no information about visual styles
Avtem
24-May-23 14:04pm
View
As i mentioned in other comment - i am looking for an existing library that solves the problem entirely.
i could spent several days on developing such library, but it's not worth the effort and time
Avtem
24-May-23 10:46am
View
Sorry, my bad - i provided a bad example. i already fixed it.
Hopefully i'll find a library that can do equations
Avtem
23-May-23 15:22pm
View
i apologize! i didn't notice that my example equation wasn't even solvable! i changed the example string to a solvable "62 = x * 1000"
Sorry, only now i realize that i should have mentioned that i am only looking for an existing library. i could implement this library, but it's not worth the effort and time.
Avtem
23-May-23 14:41pm
View
So far i haven't found any code that solves the problem i am trying to solve.
Unfortunately googling for "solver C++" gave me results that don't mention equations with one unknown variable
Avtem
23-May-23 13:23pm
View
"Your program should solve them exactly as you would do it yourself." - but to implement such a functionality probably will require hundreds lines of code - parsing numbers, signs, operator precedence and of course testing and error handling.
TinyExpr is only capable to solve one part of equation and it's already pretty large.
i feel like someone already created such a library, that's why i asked for help, because i haven't found one yet.
Avtem
26-Apr-23 6:07am
View
The style currently fits perfectly my needs. i think i will do what .Net probably did - just make a wrapper for a Combobox and handle it myself. Since i already wrapped a part of WinAPI in my own library, it will be handy to have a wrapper for combobox as well
Avtem
26-Apr-23 5:32am
View
My combobox has CBS_DROPDOWNLIST style. And remarks section of CBN_EDITCHANGE says "If the combo box has the CBS_DROPDOWNLIST style, this notification code is not sent."
Even if i could react to entering characters while combobox is focused, how do i retrieve the entered text?
Avtem
26-Apr-23 5:12am
View
Hm, unfortunately i don't see such notification:
Combobox notifications
Also i just realized simply modifying WM_CHAR messages won't work because you have to keep track of the characters, reset it after a certain amount of time, etc.
Avtem
26-Apr-23 5:04am
View
Hm, so you would have to subclass the combobox windows procedure, catch all WM_CHAR messages and in there send messages CB_FINDSTRING to find out whether there any matching items and if there is, set the combobox index?
Avtem
26-Apr-23 4:48am
View
Thanks for the answer, but this is .Net, not WinAPI. i've read the link you provided and it doesn't have any WinAPI-related clues unfortunately.
Avtem
9-Oct-22 8:26am
View
Can you show your code for the SetTimer and TimerProc? If the types are the same, it shouldn't crash
Avtem
24-Sep-22 4:34am
View
Sorry, i think you misunderstood my post. i do not implement an IDE myself. It's about changing Visual Studio settings
Avtem
24-Sep-22 4:29am
View
What is a "form"?
Avtem
24-Sep-22 4:24am
View
Isn't Form designer a tool that is used to create code?
P.S. the topic is about IDE settings, there is no programming involved
Avtem
17-Sep-22 1:12am
View
Wow! i actually had a different problem: my icons were incredibly ugly if you disable the button. Enabling visual styles fixed that problem!
Avtem
20-Jul-22 8:51am
View
For those, who find difficult to understand cppreference i strongly recommend this site for learning C++: After i read the article i was knowing and understanding anything from this topic:
https://www.learncpp.com/cpp-tutorial/sharing-global-constants-across-multiple-files-using-inline-variables/
Avtem
1-Feb-22 12:01pm
View
Anyway, i think what i will do is i copy the file to temporary path without spaces # and % and open it from that location.
i appreciate so much your help and i am happy that after such long time i know where is the problem!
Avtem
1-Feb-22 11:47am
View
Hm, with quotation marks:
HtmlHelpW(mainWnd, L"\"C:\\User guide.chm\"", HH_DISPLAY_TOPIC, 0);
it just does not open the file. GetLastError() returns 0 and the first file opens normally (it's not surounded with double quotes)
Avtem
1-Feb-22 11:34am
View
i added the code to the original question.
i think i found out why it fails and it seems to fail because of the path. To me it looks like it fails because of spaces in the path (i am aware of % and # which don't work with .chm)
Avtem
1-Feb-22 11:11am
View
Okay, i just finished writing the code in empty project and it worked! Unfortunately, my app is already finished and there's about 2-3 thousand lines of code, so i am afraid the bug is somewhere else...
Avtem
1-Feb-22 11:04am
View
The API is written in C, i use C++. Create call, i forgot that this function has more than 1 parameter... Adding the code!
Avtem
4-Dec-21 2:19am
View
But who is the process that generates the message? Is it some kind of a system process or is it the process that receives the message (for example WM_PAINT)?
Avtem
2-Dec-21 5:33am
View
Yes, before I create my Main window, it has size of 10, and inside my main loop... Well I found the problem - it was inside DLL and was caused because "myAppHWND" was not shared between all DLL's thus for my process it was correct, but for other processes it was always 0.
And still, I am not sure about main question: When I am inside hookProc(), and hookProc() catches a message from let's say Notepad.exe, is it inside Notepad.exe process or is it some other process?
Avtem
2-Dec-21 5:21am
View
I do not have a function in DLL to retrieve the size of the vector. I use size() member function of the std::vector directly - objects.size() inside my hookProc()
Avtem
2-Dec-21 4:37am
View
Sorry, I try to remove all irrelevant code when I ask questions. I will add more code
Avtem
30-Oct-21 9:05am
View
It's a shame. 1 picture is worth 1000 words
Avtem
29-Oct-21 4:27am
View
i am sorry, but for me it is really hard to understand what you wrote here. "The label tip has some standard amount of characters" - aren't labels truncated based on their width relative to column width?
"Your flag is to override that default behaviour" - What does it actually override? A lengthly text won't be truncated anymore?
Avtem
25-Oct-21 23:26pm
View
But what if it does work and I just have an incompatible flag on my ListView? BTW i use LVS_REPORT
Avtem
8-Oct-21 7:23am
View
Yeah, i see it now!
Avtem
8-Oct-21 6:38am
View
Oh, someone's using that? That's interesting!
Avtem
9-Aug-21 4:27am
View
Well, it works perfectly.
Maybe i could not find the answer using Google because others understood it right away
Avtem
9-Aug-21 4:00am
View
Oh, there are more important things that i told them about, but they do not anything about it (Crashes in Visual Studio).
Anyway - did i understand how to use it properly?
Avtem
8-Aug-21 14:12pm
View
Yep, it does seem to work, but i think i will stick with "intended" way to use it (if i understood it correctly).
Thank you!
Avtem
8-Aug-21 14:09pm
View
Wow. i found how to do this by accident... Turns out if you want to handle combobox changes you have to handle CBN_EDITCHANGE which is not sent when user selects an item in the listbox and handle CBN_SELCHANGE, but not use WM_GETTEXT this time. They decided that programmer must retrieve Edit text by getting item in the listbox by index sent with CBN_SELCHANGE notification.
This is so confusing to me. Why just don't send CBN_EDITCHANGE for any change in the edit?
Avtem
8-Aug-21 13:40pm
View
Deleted
So i did study how to use it. Turns out when i posted this question my code was almost the right way to do it. So the issue is still unsolved and i think it is a bug in Microsoft's code for this style.
Avtem
8-Aug-21 12:28pm
View
Thank you!
Avtem
8-Aug-21 12:17pm
View
But that is my question - what is the right way to get data from the control?
Avtem
7-Aug-21 12:28pm
View
The only way i could get the
current
text was:
1) Get Edit handle of the combobox
2) Subclass the edit control
3) Get text on WM_PAINT (WM_SETTEXT gives previous results as well...)
Avtem
28-Jun-21 2:32am
View
Deleted
From documentation for WM_CLOSE message: "If an application processes this message, it should return zero.". Your code DOES process this message, so i would return 0 in the future when processing WM_CLOSE!
Avtem
6-Feb-21 6:05am
View
Thank you for your help! i'll try to put it in appropriate place!
@OriginalGriff yes, you are right i have never posted a Tip. Only asked questions
Avtem
7-Dec-20 7:57am
View
But that is the point of my question. i wanted to define the variable only once and use it in all files. But i like the way you propose to achieve result i need.
Avtem
6-Dec-20 13:56pm
View
Thank you for pointing that out. Definitely something i have to work on)
Avtem
6-Dec-20 13:33pm
View
Oh, it's interesting! i need to expand my knowledge about c++ in this direction)
Thank you very much for your answer!
Avtem
26-Oct-20 13:16pm
View
All my windows are set to "Auto-hide". So when i press ESC, it focuses the text editor and hides all windows (if it does not contain a mouse cursor).
Basically what i want - press the ESC key and it focuses text editor and hides other windows
Avtem
22-Oct-20 11:21am
View
"You can define it in the Project Properties" Yes, i knew that, it is written in my original post. And the second way CPallini pointed out a few minutes ago. But thank you for your answer!
Avtem
22-Oct-20 11:00am
View
Oh, so i see now. Thank you for your answer.
Well, it's great that we can set UNICODE macro this way=)
The link was very useful as well!
Avtem
20-Sep-20 0:21am
View
Thank you for your answer! That's a great improvement to the code! i really like it.
Avtem
20-Sep-20 0:13am
View
Thank you for the answer! i will consider this solution for the future.
Avtem
19-Sep-20 13:48pm
View
Yes, it's a bit strange to see such answer when it was all understood and fixed.
Avtem
19-Sep-20 12:32pm
View
And i've just read that amount of GDI objects is limited, so it seems like my program was allowed to create only 9989 brushes =)
By the way, what it was deleting all the time? If it was deleting stock objects, then it should recreate them somehow...
Avtem
19-Sep-20 12:17pm
View
Oh, that's it! i know that i have to release and delete everything with GDI, but i missed up those lines!
So, i fixed it like this:
"FillRgn(hdc, hrgnClip, hGlobalBrush);"
and of course the call "DeleteObject()" is no longer needed, but i do remember to delete "hGlobalBrush" at WM_DESTROY.
Thank you so much!
Avtem
19-Sep-20 12:09pm
View
But it changes the arrays, you can see that in the screenshot
Show More