.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

CreateWindowEx(...) P/Invoke Confusions with Window Styles and Extended Window Styles?

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :.NET Framework
I am trying to create a window manually from C# using P/Invoke in order to make a tiny wrapper for some calls into Direct2D for a small application that is written in a functional idiom.  However, I am having a problem with a basic call: IntPtr hwnd = CreateWindowEx(0x16010000u, sWindowName, sClassName, 0x00050000u, cw_default, cw_default, cw_default, cw_default, (IntPtr)0, (IntPtr)0, hInstance, IntPtr.Zero); The first and fourth arguments which I state numerically here are bitmasks for the extended window style and the window style respectively.  I find (from Spy++) that the resulting window on execution has these style values instead: 0x16C10000u and 0x00050100u respectively.  Apparently a WS_CAPTION style is being added to my style bitmask at some point, and (perhaps consequently) WS_EX_WINDOWEDGE is being added to my extended styles.  I do not work with UIs much and have not used the window APIs from Win32 for a very long time, so perhaps I am making a silly mistake; perhaps there is some value in WNDCLASSEX that can somehow force WS_CAPTION to be added?  I am unsure if there is something obvious I am doing wrong either with the API or from the C# side.  Could I be making a marshalling mistake in the P/Invoke itself?  My extern declaration looks like this: [(DllImport("user32.dll")] s

View Complete Post

More Related Resource Links

invoke or begininvoke cannot be called on a control until the window handle has been created


Hello , Our application use the SQL 2008 R2 express edition 32/64 bit .

Now we have a new upgrade for our Application but we need to update the Existing SQL 2008 R2 express to a SQL 2008 R2 advanced services

to install the add-in Full Text Search.

When we do a upgrade during the setup , maintenance / upgrade , First we get a completed messagebox , after 1 min we get

the following error : invoke or begininvoke cannot be called on a control until the window handle has been created.

On the internet / microsoft there are patches for this known issue but not for the R2 version only for the SQL 2008 Express .

What can I do to update my SQL 2008 R2 express edition to a edvanced edition.

Anybody ?

Thanks , Yours Sincerely

Modal popup window in ASP.Net

A Masked div or modal popup window is a child window created from the parent window which prevents the user from interacting with parent window before he returns to the parent application.

lossing focus from model pop up window controls


hi i using a model pop up window with some textbox but when i click on textbox of model pop up focus move to back to page textbox control plz help me 

Open PopUp Window From Error httpModule


I would like to open a popup window from the assembly to present the information to the user. Does anyone know if this is possible, I am presently doing the following:

        WriteLine("body {font-family:""Verdana"";font-weight:normal;font-size: .7em;color:black; background-color:white;}")
        WriteLine("b {font-family:""Verdana"";font-weight:bold;color:black;margin-top: -5px}")
        WriteLine("H1 { font-family:""Verdana"";font-weight:normal;font-size:18pt;color:red }")
        WriteLine("H2 { font-family:""Verdana"";font-weight:normal;font-size:14pt;color:maroon }")
        WriteLine("pre {font-family:""Lucida Console"";font-size: .9em}")

Create a user friendly pop up window


Hello friends I am new to asp.net programming. While working with windows form(windows application) i have created a window for editing purpose(just like popup window ) which contains three bounded dropdown list a button and a gridview. After making selections from the drop down when we press button the corresponding result should display in a grid.After that when you click on the grid row it will load the corresponding datas in my form. i want to create such control in asp.net . i have to use jquery or ajax.And this pop up window i have to use more than twenty times in my application.am using VS2008 ASP.NET and C# 3.5 . Plese suggest me what to do. Thanks in advance

problem in consuming WCF service through Window application


I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0

now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error


The document at the url was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from '' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: ''.

Content Type application/soap+xml; charset

Crystal Report parameter value window.


 Hi friends,

   I am using Crystal report which displays the result of stroed procedure which have 2 paramater.

  When i run report it shows two window for getting each parameter.

  My need is, can i have one window for getting all the paramter value for stored procedure.


  With Advanced thanks,






Aero Glass: Create Special Effects With The Desktop Window Manager


In this article we introduce the Desktop Window Manager, the new interface that manages how windows are rendered on the Windows Vista desktop.

Ron Fosner

MSDN Magazine April 2007

C++ Q&A: Window Destruction in the .NET Framework


If a window is destroyed, does the .NET Framework immediately destroy the corresponding Form, or does it wait until a garbage collection to do this? How can you release my resources as soon as the window is destroyed? This month Paul DiLascia gives you the answers.

Paul DiLascia

MSDN Magazine May 2003

Windows UI: Our WinMgr Sample Makes Custom Window Sizing Simple


Programmers using Visual Basic have always had an advantage over C++ programmers when it comes to component and window sizing. There are many third-party Visual Basic-based solutions to this age-old problem, but unfortunately, there are few elegant alternatives for the C++ crowd, short of using a full-fledged windowing toolkit. This article explains how to circumvent the tedious task of hardcoded pixel arithmetic. It starts by introducing a window sizing rules system, and then moves on to show how CWinMgr, a data-driven class, can intelligently manage an MFC application's window sizing.

Paul DiLascia

MSDN Magazine July 2001

way of calling "javascript function of parent window from child window."

The article way of calling "javascript function of parent window from child window." was added by raja.s on Sunday, June 06, 2010.

Hi,Here i am going to explain how to call the javascript function of a parent window from the child window(pop-Up).Some may know before reading this post.Parent Java Script Function:script language="Javascript" type="text/javascript">
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend