Hi all, i am not looking for something sophisticated but just to read the "Location" field that i insert in the computer's Regional Settings menus..(in Control Panel) any ideas how to get it? (i do not want to find out through the IP) Thnaks,
R.Z
Hi all, i am not looking for something sophisticated but just to read the "Location" field that i insert in the computer's Regional Settings menus..(in Control Panel) any ideas how to get it? (i do not want to find out through the IP) Thnaks,
R.Z
my keyboard class is supposed to prevent keys from being sent to the current active window. when there is no heavy work on my program it blocks all chars and Notepad do not show any chars. when i write (for testing) Thread.Sleep(1000) in the KeyDown event in the main program , Notepad then display the characters even that i blocked them (return 1 on the hook). i have seen then even if my Hook gets the message later, the Notepad already displaying the char. this is the main core of the listening: KeyboardHookProcedure = new HookProc(KeyboardHookProc); hKeyboardHook = SetWindowsHookEx( WH_KEYBOARD_LL, KeyboardHookProcedure, Marshal.GetHINSTANCE( Assembly.GetExecutingAssembly().GetModules()[0]),0); the SetWindowsHookEx defined like that: [DllImport("user32.dll", harSet=CharSet.Auto,CallingConvention=CallingConvention.StdCall, etLastError=true)] private static extern int SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId); Whats is IRRC and how do i do that? Thanks,
R.Z
Hi, thanks for quick reply. i don't start my program as a Thread t=new Thread... the program's thread starts like this (and it is STA) : [STAThread] static void Main() { Application.Run(new Form1()); } any ideas?
R.Z
Hi all, i am using a clasic low-level hook for the keyboard and runing it in the main class: kBHook = new KeyBoardHook(); kBHook.KeyPress+=new KeyPressEventHandler(kBHook_KeyPress);/// kBHook.KeyDown+=new KeyEventHandler(kBHook_KeyDown); kBHook.KeyUp+=new KeyEventHandler(kBHook_KeyUp); so KeyBoardHook is another class on my project. it happens that when my program is busy doing calculations the keyboard class misses KEYUP/KEYDOWN messages. so my questions are: 1. how can i make another thread that always listen to messages? 2. can i try to hook to keyboard in a way that i will always get the messages (i need my program to get those msgs before others) Thank you,
R.Z
Im trying to do something like MSN's user online notification. the small form never get the focus, but it always on-top. so it is possible.
R.Z
Hi all I'm trying to make something like the online notification from MSN, so i want the pop-up form not to recieve any focus at all. what i have done so far: 1. overrided the property ShowWithoutActivation to return true so that when the form is displayed, the form is not activated!!(and i see that activated event do not occur) protected override bool ShowWithoutActivation { get { return true; } } 2. i make sure that the MsgForm.TopMost=false because the topmost feature always activate the form which is bad. because then , after i click first time on the notifiation form it starts to get the focus when i pop-up it. the problem: if i dont use the TopMost, its working fine but.. i need it to be on top of programs otherwise it will not be shown. Please help me. Thanks.
R.Z
Hi all if it intrests anyone.. the notification message that i was talking about was set with TopMost=true this cause auto activation and force to get focus. thats why it got some last focus. why i did is overided the property ShowWithoutActivation and everything start to work. protected override bool ShowWithoutActivation { get { return true; } } thanks man.
R.Z
Hi, 1. it's the required work-around but how can i disable that? can i disable focsu from my application at all? 2. if not, then which event should i listen to? cause i have main form (not visible) and the notification form . so to which one? 3. can i listen to Application/Process gotFocus event? Thanks for your help.
R.Z
Hi i have a problem i don't know how to handle. it is not easy to explain so feel free to ask me more details.. my main program runs in the backround with notifyIcon. i have an extra class which is a form of notification (like msn notification message). the program should run on the background and pop up the small MSN-like form on the buttom of the screen. i want the user to type in any window and on some case i show the notification message. at first run of the programm(the user didnt choose items on the small notification message so from some reason it works in the beginning), the user is typing in notepad(just an example) and when i want , i pop up the small window.. if the user don't care about it he continue to type on the notepad without loosing the focus to the noification message. the first time that the user select an item (listbox) on the message notification, then everything changes: when he types on the notepad and i popup the message notification, the focus changes to the message notification form, but i want him to keep staying focused on the notepad. what can i do? please help.
R.Z
Thats the code that give you on msn and notepad. i'm looking to work also on Word and Yahoo... private Point getCaretLocation() { IntPtr hFocus = (IntPtr)GetForegroundWindow(); IntPtr hFore; IntPtr id=IntPtr.Zero; if (hFocus != IntPtr.Zero) { hFore= (IntPtr)GetForegroundWindow (); AttachThreadInput((int)GetWindowThreadProcessId((int)hFore, id), GetCurrentThreadId(), 1); hFocus = (IntPtr)GetForegroundWindow(); Point mypoint=Point.Empty; GetCaretPos(ref mypoint); Console.WriteLine(mypoint.ToString()); ClientToScreen (hFocus, ref mypoint); return mypoint; } return Point.Empty; }
R.Z
Hi all, i am using the API : [DllImport("user32.dll")]public static extern int GetCaretPos(ref Point lpPoint); what i'm trying to do is the show contextMenu above the KB cursor. it's working good with MSN messenger and Notepad (the function returns the cursor's possition in the active window) but, in other programs like:MSWord,Yahoo messenger it returns(X=, Y=0) how is it possible? Sincerely, Ran.
R.Z
Hi all, I would like to add a control like a button to a form of another program. i allready have the handle to that form. how can i create a button and know when it is pushed and how do i add it to the other form. can it be done with sendmessage? Thanks, Ran.
R.Z
Hi all, now when i create deployment project, i have MSI and EXE files. i can install my program with my EXE only if the MSI exists. i can install it also using only the MSI file but i guess i need MSInstaller installed. I want to put in my Web site only 1 file EXE to be downloaded and it will make sure everything is properly insatlled (even if user do not have yet MSInstaller). How can i do it? Thanks, Ran. R.Z
thanks alot. haven't tried it yet but it may do the job. also the message posted before that. thank you both :-D Ran.Z. R.Z
Hi all, i have a URL and i want to get the html from that location. then i want to be able to get the BODY part and look for something there.. if posible (using some parsers) i want to get the links there and other stuff too. but how do i connect from HTMLdocument and downloading the url? Thanks alot, Ran.Z. R.Z
nice idea man :-) i have done something else. since the script is local on my computer, it do not alert any security issues when i execute a program using Shell.run("blabla.exe") so i just add a parameter to the execution with the current link. its working. now i draged it into c# issue and it will be easier for me. thanks alot, Ran Z. R.Z
Hi sorry for the late reply but it took sometime for me to test it. i managed to create and run a script that knows the URL new shortcut (its great!) but since i'm so bad in javascript , i dont know how to execute my EXE (c#) with that parameter(url shortcut). how can i do it? Thanks alot, Ran Z. R.Z
Hi all, i am looking a way to do this: when the explorer runs and the current page have a link inside it, i want to add a new item in the menu that opens when you right-click that link. so when i will right-click a link on the explorer, i will have a new option there that will cause my function to run. also i need to be able to get the current URL and the current document. any ideas? Thanks alot, Ran.Z R.Z
Hi , my application is 1 EXE file only. and i want the user to run it. if the user do not have Framework i want the installation to get it from the internet. but again i dont want it to be web based.. just 1 file (windows installer/CAB..whatever.. EXE too) that the user run and it will download framework if needed and then run my EXE (my program). again,no installation is needed (except from framework). Thnaks, Ran. R.Z
Hi all, I wonder if i can program in c# only so the framework enviournment will net be needed on deployment ? what if i have made a .NET package with forms/API/system tray and now i dont want the .net thing? can i use the code to be compiled in a non framework enviournment? Thanks, Ran. R.Z