Click here to Skip to main content
15,895,557 members
Home / Discussions / Windows Development
   

Windows Development

 
GeneralRe: Getting the interactive user's display language from a service Pin
Randor 26-Aug-21 8:02
professional Randor 26-Aug-21 8:02 
GeneralRe: Getting the interactive user's display language from a service Pin
Daniel Pfeffer26-Aug-21 17:03
professionalDaniel Pfeffer26-Aug-21 17:03 
GeneralRe: Getting the interactive user's display language from a service Pin
Daniel Pfeffer31-Aug-21 10:03
professionalDaniel Pfeffer31-Aug-21 10:03 
GeneralRe: Getting the interactive user's display language from a service Pin
Randor 27-Sep-21 7:36
professional Randor 27-Sep-21 7:36 
GeneralRe: Getting the interactive user's display language from a service Pin
Daniel Pfeffer28-Sep-21 9:16
professionalDaniel Pfeffer28-Sep-21 9:16 
QuestionDisplaying a system modal message box in the system format Pin
Daniel Pfeffer4-Aug-21 1:49
professionalDaniel Pfeffer4-Aug-21 1:49 
AnswerRe: Displaying a system modal message box in the system format Pin
Richard MacCutchan4-Aug-21 3:12
mveRichard MacCutchan4-Aug-21 3:12 
GeneralRe: Displaying a system modal message box in the system format Pin
Daniel Pfeffer4-Aug-21 3:30
professionalDaniel Pfeffer4-Aug-21 3:30 
QuestionCheck if .exe-file, WITH A PATH(!!!), is running, from within a bat-file? Pin
arnold_w10-May-21 7:17
arnold_w10-May-21 7:17 
AnswerRe: Check if .exe-file, WITH A PATH(!!!), is running, from within a bat-file? Pin
Victor Nijegorodov10-May-21 9:31
Victor Nijegorodov10-May-21 9:31 
GeneralRe: Check if .exe-file, WITH A PATH(!!!), is running, from within a bat-file? Pin
arnold_w10-May-21 9:56
arnold_w10-May-21 9:56 
AnswerRe: Check if .exe-file, WITH A PATH(!!!), is running, from within a bat-file? Pin
arnold_w11-May-21 22:35
arnold_w11-May-21 22:35 
GeneralRe: Check if .exe-file, WITH A PATH(!!!), is running, from within a bat-file? Pin
Victor Nijegorodov11-May-21 22:47
Victor Nijegorodov11-May-21 22:47 
GeneralRe: Check if .exe-file, WITH A PATH(!!!), is running, from within a bat-file? Pin
arnold_w11-May-21 23:18
arnold_w11-May-21 23:18 
GeneralRe: Check if .exe-file, WITH A PATH(!!!), is running, from within a bat-file? Pin
Victor Nijegorodov11-May-21 23:49
Victor Nijegorodov11-May-21 23:49 
GeneralRe: Check if .exe-file, WITH A PATH(!!!), is running, from within a bat-file? Pin
arnold_w12-May-21 0:38
arnold_w12-May-21 0:38 
GeneralRe: Check if .exe-file, WITH A PATH(!!!), is running, from within a bat-file? Pin
Eddy Vluggen21-May-21 11:22
professionalEddy Vluggen21-May-21 11:22 
QuestionNeed Suggestions For Uninstalling Avast Secure Browser Pin
Gregorio Pollich19-Feb-21 2:51
Gregorio Pollich19-Feb-21 2:51 
QuestionGDI drawing Pin
David Crow7-Jan-21 10:24
David Crow7-Jan-21 10:24 
AnswerRe: GDI drawing Pin
Richard MacCutchan7-Jan-21 21:23
mveRichard MacCutchan7-Jan-21 21:23 
GeneralRe: GDI drawing Pin
David Crow8-Jan-21 2:07
David Crow8-Jan-21 2:07 
GeneralRe: GDI drawing Pin
Richard MacCutchan8-Jan-21 2:48
mveRichard MacCutchan8-Jan-21 2:48 
GeneralRe: GDI drawing Pin
Richard MacCutchan8-Jan-21 4:18
mveRichard MacCutchan8-Jan-21 4:18 
Here is a very simple method of moving the box:
You need to start by calculating the value of the slope ratio between horizontal and vertical size of the Window's client area. You need this as a floating point value as it will be used to calculate positions further on.

Declare a static float value named slopeRatio, and add the following code to either the initialisation (e.g. WM_CREATE), or whenever the Window is resized (WM_SIZE).
C++
// get the slope of the client area diagonal
RECT rcClient;
GetClientRect(hWnd, &rcClient);
float horiz = (float)rcClient.right;	// Horizontal width in pixels
float vert = (float)rcClient.bottom;	// Vertical height in pixels
slopeRatio = horiz / vert;


Then when you need to calculate the new X and Y positions of your drawing (after the button press) do the following:
C++
// currentX and currentY are declared elsewhere
currentX += 30; // or whatever value you wish to move it
tempY = (float)currentX / slopeRatio;
currentY = (int)tempY;
InvalidateRect(hWnd, nullptr, TRUE);

QuestionLabview Development Pin
MarcusCole683310-Dec-20 11:18
professionalMarcusCole683310-Dec-20 11:18 
AnswerRe: Labview Development Pin
Pete O'Hanlon10-Dec-20 23:37
mvePete O'Hanlon10-Dec-20 23:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.