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 9095695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:40:14+00:00 2026-06-16T23:40:14+00:00

I am trying to implement Windows Messaging in C# in order to communicate a

  • 0

I am trying to implement Windows Messaging in C# in order to communicate a HTML page with a regular exe. What I need to do is to create a new window with a specific class name and window name, so that other processes can send Windows Messages to my Activex application.

[DllImport("user32.dll", SetLastError = true)]
        static extern IntPtr CreateWindowEx(
           WindowStylesEx dwExStyle,
           string lpClassName,
           string lpWindowName,
           WindowStyles dwStyle,
           int x,
           int y,
           int nWidth,
           int nHeight,
           IntPtr hWndParent,
           IntPtr hMenu,
           IntPtr hInstance,
           IntPtr lpParam);


            IntPtr temp = CreateWindowEx(0, "privateclassname", "privatewindowname",
                WindowStyles.WS_CHILD | WindowStyles.WS_VISIBLE, 0, 0, 1, 1,
                IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);

This is what I’ ve been trying but temp always get 0 instead of a proper window handle. What is wrong with this piece of code? I suspect hWndParent parameter. A give it 0 because I don’ t know the parent’ s handle, or it even exists. Thanks in advance

  • 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-06-16T23:40:15+00:00Added an answer on June 16, 2026 at 11:40 pm

    You are passing in WS_CHILD for a window style flag, but you are not passing a parent window handle (you are passing 0/NULL). Try removing the WS_CHILD style.

    Also, see my comment about calling RegisterClass above (if that applies).

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

Sidebar

Related Questions

I am trying to figure out how to implement an ASP.NET page with Windows
I am trying to implement rating functionality in a Windows Store application using HTML
I am trying to implement the Windows Update Agent API asynchronous download/installation methods, however,
I am trying to implement a data push from a Windows Service to a
Trying to implement google C2DM service. registrationIntent.putExtra(app, PendingIntent.getBroadcast(context,0,new Intent(), 0)); registrationIntent.putExtra(sender,example@gmail.com); context.startService(registrationIntent); Almost every
We're trying to implement a custom solution for Growl for Windows. We tell the
I'm trying to implement the infinite scrolling within a Windows Phone 7.1 project. Most
I'm trying to implement SQL Server CE code in Windows Phone 7.1 (Mango). I
I'm trying to implement Copy as path option in windows context menu ,which copies
I am trying to implement a Flash YouTube video player on this page .

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.