Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by TwILeK · Mar 30, 2015 at 09:46 AM · windows-standaloneexternal tools

How to disable: Could not register the window class, win32 error 0

I create a DLL with Windows.Forms and add it to Unity pugins directory.

In this dll i open a simple Window and create Windows.Forms components ... Yes, i required these dll, and require windows forms :)

The frist time when i call the Windows.Forms.Form f = new Windows.Forms.Form(); no error, all ok i close the window and open it again i get these error message twice: Could not register the window class, win32 error 0

But the form is open and all work correctly!

What is the problem or what is the workaround?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kaz_Yamof · Apr 02, 2015 at 03:53 PM 0
Share

I'm trying to use Windows Forms in Unity too, same problem here. Take a look an do a test: http://forum.unity3d.com/threads/problems-when-used-in-the-system-windows-forms-unity3-5-4.151964/

avatar image Crashnorun · Dec 04, 2015 at 10:36 AM 0
Share

I'm running into the same issue. Has there been a solution for this? Thanks,

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by TwILeK · Dec 05, 2015 at 06:09 PM

I make a simple app to solve this problem (i don't know why can't by Unity Dev team ....)

So, make a small app, when search and close the error window:

         [DllImport( "user32.dll" )]
         public static extern IntPtr FindWindow( string lpClassName, string lpWindowName );
         [DllImport( "user32.dll" )]
         public static extern int SendMessage( IntPtr hWnd, uint Msg, int wParam, int lParam );
 
         public const int WM_SYSCOMMAND = 0x0112;
         public const int SC_CLOSE      = 0xF060;
 
         public static void FindAndCloseWindow()
         {
             IntPtr lHwnd = FindWindow( null, "Oops" );
             if ( lHwnd != IntPtr.Zero )
             {
                 SendMessage( lHwnd, WM_SYSCOMMAND, SC_CLOSE, 0 );
             }
         }

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image PixelFireXY · May 25, 2021 at 09:04 AM 0
Share

Can you be more specific please how did you solve the problem? What I have to do with this class? Where I have to create it? Thanks :)

avatar image
0

Answer by NKCy · Dec 16, 2019 at 07:10 AM

It just happened to me too.

I think the error occurs when you rebuild the dll on Visual Studio, and go back to Unity, and try to call the dll function before newly built dll is fully reloaded.

You can rebuild the dll, then give a Unity a time to reload it will fix the problem. If that doesn't fix the error, restart Unity.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Block or Override Alt-Enter Fullscreen 4 Answers

External map creator? 0 Answers

How to Launch Windows application (build by Unity) from browser 0 Answers

How can i change the title of the standalone player window? 4 Answers

Bypassing special characters 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges