15,913,773 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 EnderMo233 (Top 25 by date)
EnderMo233
29-Nov-21 0:11am
View
Thank you, but there is another problem. If a window is closed, how do I inform the program to reorder all windows?
For example, if I close the second window (assuming there are five in total), the third window will be sorted as "2", and so on
EnderMo233
28-Nov-21 5:01am
View
Actually, I want to use it like this:
struct Data
{
int x;
int y;
int width;
int height;
const wchar_t* text;
}
std::vector<data>UserData(32);//Max:32
//then read them from file,But the window must know which window it is:UserData[i].
For example,the first window will set their coordinates to UserData[1].x and UserData[1].y,also need to save the file when closing.
EnderMo233
21-Nov-21 8:19am
View
SelectObject(inhdc, hPreBmp);
When I delected this,it works.but why?Can you answer it?thank you
EnderMo233
21-Nov-21 7:55am
View
store stable data,That's what I want.
but when I try to display it,it is all black.
EnderMo233
21-Nov-21 5:23am
View
After debugging, this has nothing to do with the value of dystate, but the value of inhdc is not saved, so the interface is black
EnderMo233
20-Nov-21 4:57am
View
I have already using MemDC,but how can I save drawing cache into bitmap,and when I refresh the window it use BitBlt to show the bitmap instead of drawing again?
EnderMo233
2-Oct-21 5:07am
View
Thank you for replay.
I means,in my code,the window redraw when everytime I move my mouse,it takes up a lot up CPU.
So,I only wanted to redraw the window for only once if my mouse is not in the clickarea.here is an image.
http://db.vertexstudio.xyz/lnk/PanelPic/debuginf.png
case WM_MOUSEMOVE:
{
//CreateClickEvent(hWnd, rc.right - 40, 0, 40, 40, lParam, CloseWindow, L"Init");
CreateMouseEvent(hWnd, 20, 60, 140, 40, lParam, test, L"Init",L"Button");
CreateMouseEvent(hWnd, 20, 120, 140, 40, lParam, test3, L"Init", L"Button");
CreateMouseEvent(hWnd, 20, 180, 140, 40, lParam, btn3, L"Init",L"Button");
CreateMouseEvent(hWnd, rc.right - 40, 0, 40, 40, lParam, CloseWindow, L"Init",L"CloseButton");
break;
}
"Init" means the first panel.
EnderMo233
2-Oct-21 5:00am
View
if you use global var,and if there is more than one MouseEvent in this panel( in CreateMouseEvent(hWnd, 20, 60, 140, 40, lParam, test, L"Init",L"Button"),"Init" is a panel).
EnderMo233
2-Oct-21 4:48am
View
by the way,leave means is has been hoverd,but you can see there is a lot of "CreateMouseEvent" there,and I don't know what should I do next.
EnderMo233
1-Oct-21 20:50pm
View
I will show you more to makes this more clearly.
http://db.vertexstudio.xyz/lnk/PanelPic/debuginf.png
and also,show you more codes.
case WM_MOUSEMOVE:
{
//CreateClickEvent(hWnd, rc.right - 40, 0, 40, 40, lParam, CloseWindow, L"Init");
CreateMouseEvent(hWnd, 20, 60, 140, 40, lParam, test, L"Init",L"Button");
CreateMouseEvent(hWnd, 20, 120, 140, 40, lParam, test3, L"Init", L"Button");
CreateMouseEvent(hWnd, 20, 180, 140, 40, lParam, btn3, L"Init",L"Button");
CreateMouseEvent(hWnd, rc.right - 40, 0, 40, 40, lParam, CloseWindow, L"Init",L"CloseButton");
break;
}
thank you for helping me.
EnderMo233
1-Oct-21 7:30am
View
It is a button in windowless framework.
So if your pointer is in the rect,it means hover and it color get darker and lighter,and if pointer is not in rect,it means leave and the control turned in to normal.
but,it cause a problem.
When your pointer is not in the rect,and window redraw everytime when you move the mouse,and it takes up a lot of CPU,so I wanted to redraw the window only once to make the button normal but don't want to redraw everytime I move the mouse.
also if mouse is in the rect ,it still redraw when I move the mouse,I also wanted to redraw it only once.
EnderMo233
1-Oct-21 7:12am
View
Could you please to modify my code?
When I do it by myself it still seems useless
EnderMo233
27-Sep-21 1:14am
View
Okay,I will have a try.Thank you!
EnderMo233
26-Sep-21 8:23am
View
Thanks for you help.
Here's another question.you can see ClickArea() function in my code,here cause a problem.
Here is a new button created on the panel,so there will be two click area in the window.
I only wanted to use ClickArea() instead of create two function like ClickAreaA/ClickAreaB.
RUNFUN test()
{
//MessageBox(0, L"TEST", L"TEST", 0);
//The event of button
return 0;
}
RUNFUN test2()
{
MessageBox(0, L"TEST", L"TEST2", 0);
//The event of button
return 0;
}
case WM_LBUTTONUP:
{
ClickArea(hWnd, 20, 20, 140, 40, lParam, test)
ClickArea(hWnd, rc.right - 160, rc.bottom - 60, 140, 40, lParam, test2)
return 0;
}
but only the last function works.
Any idea to slove it?
thank you very much!
EnderMo233
25-Sep-21 5:27am
View
I try to give each panel an ID,it works.
RUNFUN test()
{
RECT rc;
HDC hdc = GetDC(GhWnd);
GetClientRect(GhWnd, &rc);
PanelID = 1;
InvalidateRect(GhWnd, &rc, 1);
return 0;
}
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hWnd, &ps);
// TODO: 在此处添加使用 hdc 的任何绘图代码...
if (PanelID == 0)
{
CreatePanel(hWnd, hdc, Panel1);
}
if (PanelID == 1)
{
CreatePanel(hWnd, hdc, Panel2);
}
EndPaint(hWnd, &ps);
break;
}
but when click a button,it not only respond on RUNFUN(),I also need to respond it in WM_PAINT.
Now I just wanted to ask an idea of SwitchPanel().
Like I can use SwitchPanel(Panel2)to switch to panel2.
EnderMo233
25-Sep-21 4:52am
View
https://db.vertexstudio.xyz/lnk/PanelPic/1.png
https://db.vertexstudio.xyz/lnk/PanelPic/2.png
Here I add two images.
The page with "Create Panel2"button is the initial panel,and the page with dark background is the panel after click the button"Create Panel2":
void Panel1(HWND hWnd,HDC hdc)
{
CreateFillArea(hWnd, hdc, RGB(255, 255, 255));
//CreateRect(hWnd, hdc, 20, 20, 100, 40, RGB(16, 141, 218));
CreateSimpleButton(hWnd, hdc, 20, 20, 140, 40, L"Create Panel2");
}
void Panel2(HWND hWnd, HDC hdc)
{
CreateFillArea(hWnd, hdc, VERTEXUI_DARKEN);
//CreateRect(hWnd, hdc, 20, 20, 100, 40, RGB(16, 141, 218));
CreateSimpleButton(hWnd, hdc, 20, 20, 140, 40, L"Close Panel2");
}
however,I wanted to use this to change panel:
void SwitchPanel(DRAWPANEL p)
{
//
}
So it can use SwitchPanel(Panel2) to change the panel of the program,and more convenient,I want to find a way to realize this.
EnderMo233
25-Sep-21 4:20am
View
I still don't know how to realize it.Could you just give an example?Thank you!
EnderMo233
12-Aug-21 0:23am
View
okay,I have added images to the question
EnderMo233
12-Aug-21 0:12am
View
I will upload the problem image to my website,then I will Improve question.wait.
EnderMo233
11-Aug-21 21:45pm
View
is it mainly is about the program move outside the screen and the window redraw frequently?
How can I solve it?
thank you.
EnderMo233
30-Jul-20 23:09pm
View
how can I ask question on EFNet?
EnderMo233
30-Jul-20 8:34am
View
I don't seem to have used setwindowpos
Because I have added the into tab, each button is a sub window. If I want to hide the "console UI" sub window when I click the "testtab" button, then it is not possible to hide the "console UI" sub window when I click the "testtab" button, because they had different hwnd. How can I hide the "console UI" child window and display another one when I click the "testtab" button?
thank you.
EnderMo233
30-Jul-20 7:12am
View
My window is a self - drawn borderless window and disabled resizing.
I used the above code to make a sub window, but how to switch the interface when the user presses different tab buttons
For example, by default, "console UI" is the most interface, and the "console UI" tab is "console". If I want to create a new "testtab" button, I need to hide the "console UI" sub window and display a new sub window when I click it
EnderMo233
29-Jul-20 22:27pm
View
Now my UI looks like the following link
http://db.endermo.xyz/lnk/UI.png
Each control is Child Window of hwnd
LargeTitlebtn(hwnd, 1, 1, 160, 50, L"Title", NULL);
FrameClose(hwnd, rect.right - 20, 16, CLOSE);
FrameMinimize(hwnd, rect.right - 60, 16,IDC_MINIMIZE);
FrameMenuBox(hwnd, rect.right - 100, 16, IDC_MENUBOX);
ConsoleUI(hwnd, rect.left + 161, 51, 669,459, NULL);
I want to add the sidetab in the left(DarkGrey Area)
Should I Make the tab in a child window?How to switch the interface when switching the tab?
EnderMo233
29-Jul-20 22:24pm
View
Deleted
Now my UI looks like the following link
http://db.endermo.xyz/lnk/UI.png
Each control is Child Window of hwnd
LargeTitlebtn(hwnd, 1, 1, 160, 50, L"Title", NULL);
FrameClose(hwnd, rect.right - 20, 16, CLOSE);
FrameMinimize(hwnd, rect.right - 60, 16,IDC_MINIMIZE);
FrameMenuBox(hwnd, rect.right - 100, 16, IDC_MENUBOX);
ConsoleUI(hwnd, rect.left + 161, 51, 669,459, NULL);
I want to add the sidetab in the left(DarkGrey Area)
Should I Make the tab in a child window?How to switch the interface when switching the tab?
Show More