|
I think I've read somewhere that the reason for it is the extremly large header included with the .NET framework. If for example you create an MDI application which spawns child windows inside the parent those new windows wont take a lot of memory.
|
|
|
|
|
Yes, I have noticed this too...I've assumed it was related to the .Net framework. I have used Java before this, though, and I think it was even more memory hungry.
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|
I'm trying to make an app that catches the clipboard data when somebody press print screen. The problem I'm facing is to determin if the user has pressed print screen, the event needs to be triggerd even if my app doesn't have focus. So what I'm wondering is if there's any reliable way to do this without hooks and that sort of stuff (which I know nothing about hehe). All I need is some keywords or perhaps a good article/tutorial .
just figured it out, no need to answer this one.
|
|
|
|
|
Since your application doesn't worn the desktop window, you'd have to set a Windows hook. They're not as hard as you think, and MSDN even has examples. Lookup the functions SetWindowsHookEx and UnhookWindowsHook . The topic "Win32 Hooks" even has sample code.
Another way might be to P/Invoke the functions SetClipboardViewer and ChangeClipboardChain . Then call SetClipboardViewer with your window handle (Form.Handle.ToInt32() ). When the clipboard is changed, your application is sent the WM_DRAWCLIPBOARD message (DWORD, 0x0308). You must also P/Invoke SendMessage so that when WM_CHANGECBCHAIN is passed (when the clipboard chain changes, i.e. a viewer is added or removed) you can pass the HANDLEs that you received from calling SetClipboardViewer . This may sound complicated, but it's not. Essentially, you're just inserting yourself in a chain and handling messages passed to that chain. When you get the WM_DRAWCLIPBOARD message, you can use all the .NET class library's members for accessing the clipboard, checking for DataFormats.Bitmap or some other string (even your own). This would tell you that an image was copied, though, not that the PrintScreen key was pressed.
You could compare the size of the image with the size of the screen, but that only gives you a probable screenshot.
Basically, a windows hook is the way to go if you want a true handle for PrintScreen. The other is just an alternative if you just want to know when an image was copied to the clipboard.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
thx, I'm looking into it
|
|
|
|
|
I am writing an application that has two modes 1) Normal Windows Forms based UI operation, 2) batch mode no UI mode operation using the same codebase.
On application start I would like to test for a parameter, and, or read a configuration file flag to determine which mode to operate under, then if UI mode, instantiate the main form and operate Windows application normal. If batch mode, either branch to other application logic or operate with the main form minimized or invisible. To do this, I would like to launch the application from a non-form based class like AppStart.cs with the application main method hosted there instead of in the main form, and I would like to show a Splash screen while I do some setup configuration work before before real processing begins . So the flow would be like this:
1. Main method kicks in from generic class...
2. New thread is started to manage splash screen based on a timer...
3. Configuration file is read to check batch mode flag...
4. If mode is UI, then when Splash timer is finished do Application.run and instantiate main form...
5. If mode is Batch, then either instantiate main form invisible, or run the applicaion without the main form...
Can anyone point me towards and example of starting a windows application from a main class instead of from a form? I thing this will have something to do with using the application context, and threads to do what I'm trying to do...?
Thanks!
|
|
|
|
|
Hi. I have a combo box, that when the selection is changed, I dont want it to do anything (at the moment, as I am using dataBinding, it tries to change the index, as I have a listBox with different categories, and the comboBox changes that category). I want to it to stay in the same place until the user clicks on an update button. Anyone know how to achieve this?
|
|
|
|
|
This hangs...
Any clue ?
Thanx
|
|
|
|
|
I've got a webservice that works fine from my work machine but if I try it from home I get the following error message:
"The underlying connection was closed: an unexpected error occurred on a send"
Any ideas? I use a windows forms app to call the webservice. I'm connected to the internet and can access the website that host the webservice.
I'm stumpped!
Thanks in advance
Andy
|
|
|
|
|
Did you try checking the WebException.ProtocolError property.
- Kannan
|
|
|
|
|
Hi,
I have a very "simple" problem, but i dont know how to sove it. I want to show a contextmenu, where one menu item is a textbox (ex. Right click on a cell of a open access table in access).
Can anyone help me?
almigrp (Misel)
|
|
|
|
|
You're going to need to use owner-drawing. Basically, set the MenuItem.OwnerDraw property to true and do a lot of coding. There are some good articles about this in Dr. GUI.NET in MSDN.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
Yes, that's right....you will need to owner draw (by setting to true) and then do your own drawing code.
I don't know how much this will help...but I wrote this article when I wanted to learn how to put images in menus.
http://www.codeproject.com/cs/miscctrl/CS_Menus.asp[^]
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|
|
Images are no problem, but i don't know how to create a textbox without binding it to a form.
I am stuck there
almi (misel)
|
|
|
|
|
hi,
I have some question on Image Transform. \
In my application, it contains an image that is drawn by Graphics.drwaImage(). the image's default size is 100 x 100 , how can I do, if I want to transform it to 200 x 200?
The other question, is there any way I can transform image without distortion?
Thank you.!
|
|
|
|
|
I am going to show some pictures one by one to user on my form. It seems more beautiful to switch between this pictures with some special effects! is there any control to do this for me?
Don't forget, that's " Persian Gulf " not Arabian gulf!
|
|
|
|
|
hello,
here is the problem i am looking for solution.
question is , can i programmatically clik the Ok button of message Box and also can i set its visible=false?
actually i have to refresh a web page ( IE is embeded in my application) after some time. i have tried SLEEP() method but its not working.
so i thought why not to do this with message box.
CAN I?
looking for solution.
ASIM
Asim
|
|
|
|
|
Have you looked into the Timer object, in the System.Timers namespace?
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Hello
I have a simple form with some buttons among other thing on it.
Is it possible to change the normal state of form to fullscreen? Note that i don't want to set the width and height of my form to width and height of screen.
thanks
Don't forget, that's " Persian Gulf " not Arabian gulf!
|
|
|
|
|
Set the FormBorderStyle to none, and maximize it.
Note that i don't want to set the width and height of my form to width and height of screen
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Really so simple! I was thinking of how whould task ber get hidden, but it seems that when we set the WindowState property to Maximizd , the taskbar automatically becomes hidden
Don't forget, that's " Persian Gulf " not Arabian gulf!
|
|
|
|
|
When you do this, all appbars, including the taskbar, get a notification that a full-screen app wants the whole screen, so they run and hide.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I downloaded and installed CsGL, because I was interested in OpenGL programming with C#. And I ran into a little problem: the drawing code for the scene ( placed in a method render() ) only gets called during painting. But I need to update my scene much more often than when WM_PAINT is processed. I want to have a smooth animation, something complex, like a spinning triangle . When I used C++ and the Win32 API, I replaced the traditional while(GetMessage()) with if(PeekMessage()). If there was no message in the queue (the app was idle), then I would call my render(). But there is no OnIdle(), or something similar, for a C# Form. I digged around, and found that the Application method had an Idle callback (delegate, whatever) I could use. So I plugged render() to it. But it doesn't work properly (if I continuously move the mouse pointer inside the client area really fast, it works; otherwise, no). Besides, the Application object is global. Maybe I'll want an Idle event handler for more than one form. Right now I'm doing it with timers (every 10 ms, a Paint is triggered), but that's suboptimal (altough it works). Does anyone have a better idea?
|
|
|
|
|
Hi, just 3 short questions.
Firstly, anyone know where you can get hold of the windows XP icons? I mean the standard ones for copy, save, etc?
How is it possible to authenticate a user against Active Directory, and receive certain information such as email addresses?
Also, do you perhaps know of a good tutorial using a client to send email through exchange, or, if you can just make an independant program to email?
|
|
|
|
|
1) Shell32.dll
2) System.DirectoryServices.dll
3) Outlook
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|