Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
K

Krzysztof Gorgolewski

@Krzysztof Gorgolewski
About
Posts
17
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to get the HWND from the windows on the "locked screen"
    K Krzysztof Gorgolewski

    still i didn't had time to try anything new, but i let you know. regards

    C / C++ / MFC tutorial question

  • how to get the HWND from the windows on the "locked screen"
    K Krzysztof Gorgolewski

    one more thought in the morning: once i used an application called Active Desktop Calendar. and it was displaying its calendar/todo/etc also on the locked screen. soo that means, if this application is able to access the Winlogon desktop, why should i not be able? regards

    C / C++ / MFC tutorial question

  • how to get the HWND from the windows on the "locked screen"
    K Krzysztof Gorgolewski

    oh yes: http://msdn.microsoft.com/en-us/library/ms682573(VS.85).aspx => "... Applications cannot access the Winlogon desktop ..." maybe i can change the access rights for my "default" desktop/program somehow to get to this "winlogon" desktop's content?!? criss

    C / C++ / MFC tutorial question

  • how to get the HWND from the windows on the "locked screen"
    K Krzysztof Gorgolewski

    thanks for your thoughts. hm... so it's not possible because of security reasons? not nice to hear... i already got the message, when the screen/computer is locked (after the lock i'm changing the wallpaper and additionally wanted to move the f§%*$ng ... ehm ... nice "computer locked" window). ok, GetLastError i will have to check later. and the thing with a different desktop was/is also in my mind. maybe it's possible to find/enumerate through the available desktops and have a look for my desired window (if the security allows it : ) so long

    C / C++ / MFC tutorial question

  • how to get the HWND from the windows on the "locked screen"
    K Krzysztof Gorgolewski

    hi there, i'm trying to get the window handle from the only window, when my windows is locked. it has the "Computer Locked" title, so first i tried FindWindow(NULL, "Computer Locked"), but nothing. then i tried GetWindow(GetDesktopWindow(), GW_HWNDFIRST), because it's the (hopefully) one and only active window on the locked screen. but nothing. and i also tried WindowFromPoint with the mid point of my screen, because the "computer locked" window is centered an the screen. but no luck at all. sooo, anyone an idea or hint, how to get this _hard to get_ window handle? regards ps: google is also not giving any useful results

    C / C++ / MFC tutorial question

  • usb keyboard emulator (but software:) [modified]
    K Krzysztof Gorgolewski

    hm... so such a hardware device is definitively necessary because a direct usb-usb or rs232-usb connection is not possible (electric/hardware/conversion issues)? also if all the device driver stuff is done? regards, criss

    Hardware & Devices php database help tutorial question

  • usb keyboard emulator (but software:) [modified]
    K Krzysztof Gorgolewski

    hi out there, i don't know if i'm at the right place with my problem, but i will try. i tried weeks ago some times the usb forum (http://www.usb.org/phpbb/index.php) but these nice guys are not activating any new user accounts :( ok, is it possible to make an usb keyboard emulation, that means connecting 2 pc over usb or rs232 to usb, one pc has no keyboard and will be feeded with keyboard signals from the other pc over the usb connection... if yes, has any one good hints (internet pages, etc) how to do it? regards criss -- modified at 10:50 Monday 10th September, 2007

    Hardware & Devices php database help tutorial question

  • how to set "automatic dns" using wmi?
    K Krzysztof Gorgolewski

    i found the solution... before calling EnableDHCP, i have to clear my DNS list by assigning an empty array to SetDNSServerSearchOrder like

    ...
    newdns["DNSServerSearchOrder"] = new string[] { };
    mo.InvokeMethod("SetDNSServerSearchOrder", newdns, null);
    mo.InvokeMethod("EnableDHCP", null, null);
    ...

    where "mo" is the ManagementObject of my networkcard. regards, criss

    C# question csharp sysadmin json tutorial

  • how to set "automatic dns" using wmi?
    K Krzysztof Gorgolewski

    hi dave, so that means, if i call EnableDHCP all entries in my dns list will be deleted and it becomes "automatic"? hm, but that's not happening somehow. i can not get rid of any static dns settings. any ideas? criss

    C# question csharp sysadmin json tutorial

  • how to set "automatic dns" using wmi?
    K Krzysztof Gorgolewski

    good evening out there, i'm working on a routine (using c# + wmi) that is able to change my network configuration e.g. dhcp<->static, different ip/gateway/subnet addresses etc (just like the build-in windows tcp/ip network configuration). everything works fine, but i can not find any way of switching between static defined dns servers and automatic leased dns servers (which i receive automatic from my router or equivalent). i mean, what is the counter part for "EnableDNS", like "EnableDHCP" is for "EnableStatic"? i can not find it in the windows api... greetings criss

    C# question csharp sysadmin json tutorial

  • thread is blocking the gui form, why?
    K Krzysztof Gorgolewski

    thanks to all i bothered with my problem. i could solve it by contacting the devices support... it really just depends on my GetImage method. anyway. greetings criss

    C# csharp help question c++

  • thread is blocking the gui form, why?
    K Krzysztof Gorgolewski

    hm... i see, so that means, there is a difference between the implementation for c++ and c#.net (which is an activex control) for this method/class. i think, i should directly contact the support for the device because it's not more looking as a .net problem, more like the implementation... thanks guffa criss

    C# csharp help question c++

  • thread is blocking the gui form, why?
    K Krzysztof Gorgolewski

    the blocking method is the "taking image" (GetImage) method. it's waiting till a signal is triggering the device DIRECTLY. for the device i can setup a "timeout" which i have to set to some seconds. so my problem is not the entire infinite busy loop, it's the GetImage method, which is not returning until it gets a trigger or a timeout occurs. because of this i put it in a seperate thread, to get the gui not blocked. i'm also confused :| btw: i'm using: winxp + .net 2 + usb connected camera device criss -- modified at 5:41 Monday 16th April, 2007

    C# csharp help question c++

  • thread is blocking the gui form, why?
    K Krzysztof Gorgolewski

    hi martin, worth to try, but i don't think so... the image is displayed correctly. just the "taking image" method causes the problem, it's waiting the whole "timeout" time for a signal (trigger) and if any occurs, then the image is coming. because of the waiting (and blocking the gui) i'm forced to use a thread. :| criss

    C# csharp help question c++

  • thread is blocking the gui form, why?
    K Krzysztof Gorgolewski

    hi luc, yes correct, but also if i'm not using the priority above normal, it's showing the busy gui. and on my side it's not safe to use a sleep in this infinite loop, because i'm waiting for trigger signals from the device and using the sleep could miss some signals. i mean, i tried exactly the same in c++ without any sleep, with and without higher priority and it's working nicely. so what's the difference between c++'s and .net's threading? criss

    C# csharp help question c++

  • thread is blocking the gui form, why?
    K Krzysztof Gorgolewski

    hi christian, in the forms constructor i'm having the following lines of code earlier listed, which should start my camerathread (the another/seperate thread) or am i wrong? and if this is not doing what i'm thinking it should do, how should it be?

    ct = new camerathread();
    ct.newimg += new newimg_handler(ct_newimg);
    camerawork = new System.Threading.Thread(new System.Threading.ThreadStart(ct.run));
    camerawork.Priority = System.Threading.ThreadPriority.AboveNormal;
    camerawork.Start();

    criss

    C# csharp help question c++

  • thread is blocking the gui form, why?
    K Krzysztof Gorgolewski

    hi, i'm having a silly problem and i'm trying to describe it as simple as possible :) i'm accessing a device which takes images. this device has a timeout property, which i have to set high (for some seconds). if a timeout occurs, it is "catched". after an image is taken, it is shown in my gui window. so, i put the device accessing part in a thread which is getting the images and sending the images to the gui. in code it looks like this:

    public delegate void newimg_handler(object sender, newimage_args e);

    public class camerathread
    {
    public event newimg_handler newimg;

    bool quitthread;
    
    imageobject img;
    
    public camerathread()
    {
    	img = new imageobject();
    	quitthread = false;
    
    	OpenImageDevice();
    
    }
    
    public void exithread()
    {
    	quitthread = true;
    }
    
    public void run()
    {
    	while (!quitthread)
    	{
    		try
    		{
    			GetImage(out img);
    			if(newimg != null)
    			{
    				newimage\_args nia = new newimage\_args();
    					nia.img = img;
    					newimg(this, nia);
    			}
    		}
    		catch
    		{
    		}
    	}
    }
    

    }

    public class newimage_args : EventArgs
    {
    public imageobject img;

    public newimage\_args()
    {
    }
    

    }

    and in the main form it's called like this:

    public Form1()
    {
    ...
    ct = new camerathread();
    ct.newimg += new newimg_handler(ct_newimg);
    camerawork = new System.Threading.Thread(new System.Threading.ThreadStart(ct.run));
    camerawork.Priority = System.Threading.ThreadPriority.AboveNormal;
    camerawork.Start();
    ...
    }

    void ct_newimg(object sender, newimage_args e)
    {
    img = e.img;
    display(img);
    }

    my BIG problem is, that the gui form is not responding while the thread is waiting for an image from the device (it can be many seconds, according to the timeout property). but why? i wrote the same application in c++ and everything is working fine (but c++ is at the moment not an option, the application has to be in c#.net). i also tried asynchron BeginInvoke calls on a method which is taking the images, but the same result. it looks like it's working sequentially, like i would use a timer for getting the images. how can i make the thread completely independent working from the gui form, so i can also interact with the gui? i'm confused about the threading under .net. any hint is welcome. help regards, criss

    C# csharp help question c++
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups