Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7418735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:56:19+00:00 2026-05-29T07:56:19+00:00

Ive got a simple modless dialog which I would like to place at the

  • 0

Ive got a simple modless dialog which I would like to place at the bottom right corner of the parent window. This is my first time working with windows forms in C (so please be patient if I don’t directly understand).

I’ve tried positoning the window with SetWindowPos, but to no avail as the coordinates x and y are relative to the top left screen corner.

//hWnd is the parent window
hwndStatusBox = CreateDialog(hInst, MAKEINTRESOURCE(IDD_STATUSBOX), 
                             hWnd, svnStatusBoxProc); 

SetWindowPos(hwndStatusBox,NULL, 100, 100, 0, 0, 
             SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOZORDER);

Am I missing a function or do I have to calculate the offset myself?

I don’t want to use the coordinates defined in the resource, i’d like to solve it programatically.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:56:20+00:00Added an answer on May 29, 2026 at 7:56 am

    For a top-level window, i.e. not a child window, the co-ordinates are indeed relative to the screen.

    You will need to read the co-ordinates of the owning window, work out what offset you need, add on the offset and finally set the co-ordinates for your dialog, relative to the screen origin. Or you can call ClientToScreen, passing hWnd, and get the system to do it for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a simple function like this: function CreateFileLink() { global $Username; return date(d-m-y-g-i);
I've got a simple java class that looks something like this: public class Skin
This is probably a simple thing, but ive got the following code: <div> @using
Ive got some in memory images in various simple formats, which I need to
I've got a simple application that shows pictures dragged onto it. I'd like the
Ive got a simple Model called Category. The model is has three fields :
I have a simple question. Ive got a trigger to insert the values into
I've got simple JavaBeans objects which represents data in my database. I want to
so ive been tryind to create a simple array list class and got stuck
I've got a simple homescreen widget, which displays a list of items. Since I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.