flarebol's Q&A profile
Windows Forms Get the handle of each open window.
I am in quite a predicament here. What I need to do is call some sort of API, (from User32 ) that retrieves the handle of each open window, (minimized or open) and store it in an array. I looked through the functions in User32...and am not sure how to use EnumWindows and am not sure if that will do what I want. The second part I need to know how to do is store them in an array. IntPtr[] hArray = new IntPtr[] Any help is appreciated. Ugh, translating C# into VB syntax always seems to more easily done by just rewriting it: Imports System Imports System.Collections.Generic Public Class WindowEnumerator Private Delegate Function CallBackPtr(ByVal hWnd As IntPtr, ByVal lParam As IntPtr) As Boolean Private Declare Auto Function Enu ...Show All
Windows Forms how to put my application on start up in deployment project
hello to all.. i have completed my project and now i am preparing a setup project for it.. does anyone have an idea abut how can i put my application on the start up menu of PC that will install my project so that whenever the user turns on the PC my application will launch automaticallly please do not offer services i am new to development and i ddi not understand much of services... It seems that auto launch the application is easy. However, how to provide options for users to switch on and off the auto launch feature later ...Show All
SQL Server MTS
What is microsoft transaction server and for what it is used Hello, MTS is now known as (included within actually) COM+. Amonst other things, it is able to coordinate distributed transactions within com+/MTS aware components. In the old days of MTS, you needed to code specifically for MTS, and manually enlist components into a distributed transaction, then register and host these components within an MTS server instance. Not sure what is required for COM+ nowadays, however a good Googling will soon solve that :) Cheers, Rob ...Show All
Visual C++ Where shall I ask the quesiton about C? E.g. Question about how to generate different random numbers...
Dear all, I had one question about generating different random numbers. One piece of my code is as follows. Actually, because of the limited time, I don't think it can work. Its principle or algorithm is only to guarantee different values between generated values border upon/nearby. However, how to guarantee the value is different with all the previous ones, not only the border upon value. void initRandom() { int i,j = 0; for (i = 0; i < 100; i++) { random_numbers = rand() % 100; // Get random number. // Try to compare the value with previous ones. for (j = i; j==0 ; j--) { if (random_numbers[j] != random_numbers[j-1]) { break; } else { random_numbers[j] = rand() % 100; } } } } Do yo ...Show All
Visual Basic Windows Service ~ Service started successfully - NOT!
Hi, I've developed an app as a windows service, which in the OnStart event calls an Init routine which sets up the service, check connection to dB etc, dump a log to the EventLog, and returns a True or False. If I get a False back, I execute a Me.Stop. In the event log, I see the log I dumped, then "Service stopped successfully.", then a "Service started successfully." message. It looks like these last two msgs are being output when the OnStop/OnStart events complete. How do I get my service to NOT output the "Service started successfully." msg when the Init routine fails, and instead output a "Service did NOT start successfully." or similar instead Many thanks ...Show All
.NET Development Programmatically determine calling method at execution time?
Without using StackFrame, how might one go about determining the method that called the current method I need this for logging but do not want to use StackFrame since it has difficulties outside of IDE environment. Looked and looked - no can find. For example, method A and B each call method C. From method C, I want to be able to log who the parent method was that called me. Thanks. From the documentation of StackFrame.GetFileName: " Gets the file name that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable". Return Value The file name. -or- a null reference ( Nothing in Visual Basic) if the file name cannot be de ...Show All
Visual C# Process class used from Windows Service fails
I'm having trouble with the Process class. I have a Windows Service running as SYSTEM and I want it to spawn processes on behalf of users. I get the user's password there securely and create a SecureString. I get a Win32Exception "Access Denied" on Process.Start. If I run the service under the same account as the user I want to start for, I still get the exception except it says "The handle is invalid". I've checked and checked the SecureString and I've made it read-only so I don't think that's it. I actually had gotten it to work some time ago if I impersonate the client but this isn't really practical since the job can be queued up waiting for some time. I've signed all the assemblies involved and I've given the ...Show All
Visual Studio 2008 (Pre-release) WSE 3.0 versus WCF
i am confused about whether i should be writing our new web services in WCF or WSE 3.0. many of our CLIENT applications still run older operating systems, such as Windows 2000. do my client applications need to be running the .NET 3.0 framework to easily communicate with a WCF web service If so this means it will only run on WinXP SP 2 and Vista right If so, should I be considering WSE 3.0 instead then Or will this be getting phased out Me confused. this post here says clients need xp sp2 or vista http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=224021&SiteID=1 "As far as client-side operating systems goes, WCF requires XPSP2 or Vista." ...Show All
Visual C++ recv won't return on socket close
Sorry to make my first post a cry for help but I'm running out of places to look. I have a TCP server that accepts connections and than handles the new client sock in a new thread. Everything is working fine except when the client closes ungracefully the socket stays open and my recv is still blocking instead of returning SOCKET_ERROR. I've shutdown the remote client box but my recv won't return and netstat still shows the TCP socket to be ESTABLISHED. It's not a huge deal but I'm leaving threads laying around and not realeasing my socket handles. Any ideas Thanks. Hi, my understanding of TCP is, that it tries to handle network problems gracefully. E.g. if you have a telnet connection to some o ...Show All
.NET Development How can I save dataset as an xml file???
Hi I am trying to save the dataset as xml file (one row from the table).Saving xml is fine but it look like the following (the below is flat xml file without root nodes and child node) But I want the data to go under xml Root Node, child node, children node and so on. My question is How can I save the dataset as xml file with Root Node, child node, children node and so on Please help !!! Urgent!! < xml version="1.0" standalone="yes" > <MS> <SDLTID>1</SDLTID> <UTRN>303783jMJ</UTRN> <TransPropertyType>01</TransPropertyType> <TransInterestCreated>FP</TransInterestCreated> <TransEffectiveDate>2006-04-05</TransEffectiveDate> and so on..... ...Show All
Visual Studio Express Editions How to open files that are used by some other procsses?
654654 njnojnoinoinoinion please restate your question clearly for us However going for your question title - sometimes it is possible depending on if the process has allowed the file it is using to be shared for use, such as read and write but other wise I believe it is locked to that application who owns the current file it is using, meaning it is the only one that has a handle to it ...Show All
Game Technologies: DirectX, XNA, XACT, etc. xbox 360 controller
Hello all. I have just puchased a Xbox 360 controller and try to figure out all the differerne possibilities. Right now i wonder about the button in the middle that looks like the xbox logo and with something that look like 4 lights around it. How can I program that one What do you call it And can I controll the lights Thanks Endre Thanks for the reply. I have never tried a real xbox 360 so i didnt know about the lights. Would have been fun to be able to use them in games. When it comes to the button I guess I have more than enught buttons to use. Endre ...Show All
Internet Explorer Development Banning from a forum?
Hello, I would like to know how does a ban from forum works Does the server ban the ip address But doesnt the ip address always change I would appreciate any help on understanding this matter. Thanks. Sounded like you were asking about banning on these forums. It would depend on your forum. If your forum requires login to perform an action then simply disabling a login might suffice if your login validation requires a valid email. You could add a rule that certain IP addresses are forwarded to a "no access" page; but that would tend to ban more than one computer as the IP a web server sees is generally the gateway's IP address. In large organizations many ...Show All
Windows Forms using button control to navigate between textboxes
Hello, I am designing a touchscreen app and am really struggling with the control navigation. I have 5 textboxes from top to bottom and I have a Button labelled "UP" and a button labelled "DOWN". What I am trying to do is when the user pushes the "DOWN" button the focus of the control will go the texbox below it, and the same when the "UP" button is pushed. So if the user keepes pushing "DOWN" the focus will move through the textboxes and stop at the bottom. any help appreciated. Regards Peter You more than likely have a problem keep track which control has the focus. As soon as the user clicks the button, you've lost track. T ...Show All
.NET Development New customer acquisition count
Hi there I have a field, customer acquisition date which is part of the customer dimension table and is a date field. I want to have a count of customers who were acquired on a specific date and I want this date to be related to my other measures, so I can show number of customer acquired and Revenue for a particular date period. Do I need to remove from customer table and create a separate fact table with customer_id and date and a value (say 1) and then join this table to all other tables Or is there a way to join the field as it is to the date table Thanks in advance Derek Hi, In addition to that, you may also want to create a view so that you can JOIN it to other tables in your data ...Show All
