I have a WinForms Application that I want to run at Mono at some point. However, it is using some P/Invoke against user32.dll, which will cause an obvious problems.
However, this is not a critical functionality, just some flavor stuff. So I would like to ignore it when running Mono.
I know I could just use an #if directive, but then I have to offer two different assemblies, which is bad. I know I can check on Runtime if I am running in Mono, but that won't help me removing the declarations to the functions.
So I wonder: Is there a way where I can say "If running Mono, ignore this completely"? If it helps: The P/Invoke stuff is in a separate .cs file and implemented as a Partial Class.
The source code in question is here: http://pastie.org/588940
It is part of my Main Form, overriding the WndProc message to add an item to the system menu. (Some other stuff snipped). My problem is that while the WndProc stuff is easy, I do not know what to do with the two private extern declarations - can I put them into another (static) class that I just never call on Mono? Or would that be russian roulette?