so I wrote a program in c# to keep rerolling character stats in a baldurs gate 2 window after finding them in memory and adding them up, and it works fine, except for one part of it..
I have an output box (created using a RichTextBox in a form) that shows how many times it's rerolled, current stats, best roll so far, etc but it doesn't work properly.
the program simulates mouse clicks on the reroll button and for some reason it will work and update and display the form for a short time and then the title bar of the form will turn that sort of faded blue like it lost focus and it won't display anything until the program is finished running.
I've tried using the form methods Show, BringToFront, Activate, SetTopLevel(true) setting TopMost=true and Focus, basically anything likely sounding, even right in the main loop but it still happens regularly some 5-10 seconds into running the program.
tl;dr I need a way of making a form in c# display and update when it's not focused, or to somehow keep focus while still letting me click another application? gah
Name:
Anonymous2008-08-15 3:53
Did you enjoy writing that program?
Name:
Anonymous2008-08-15 4:14
>>1
Presumably since your program is stuck in a loop, it can't do any of the normal bookkeeping it would do with regard to responding to events or updating its display. Insert the thing what makes it process events somewhere in your loop.
Name:
Anonymous2008-08-15 5:57
Application.DoEvents() does this, though it's not really a great solution. It might be better to subscribe to the Application.Idle event and do processing in that.
Name:
Anonymous2008-08-15 6:27
>>2
yes, it was actually my first time writing code in anything other than java.. thank community college for that. some quick googling though turned up the fact that java can't access windows api functions easily which I needed so I randomly decided to download sharpdevelop and bust out some c#.
DID YOU KNOW
..the default location for php.ini on Windows is C:\WINDOWS?
Name:
Anonymous2008-08-15 15:11
>>7
Is that even relevant to the topic, or is it just your way of saying ``I've read ``PHP for Dummies''''?
Name:
Anonymous2008-08-15 15:39
>>4
application.DoEvents() worked great, thanks! I'm gonna try a version using the idle event just to see how that works, not that the program really needs to be perfect.
>>6
I'm hardly out there in industry, but isn't java pretty much dominating the job market? i'm pretty sure the community doesn't need another pre college grad writing awful code.
besides, 3 years into a computer engineering degree (out of 5.. that's how long it takes to get a bachelors at RIT, with the co-oping they make you do) they're finally going to be teaching me C. the community college I went to first only taught java, which is sort of irrelevant in my future field :( With any luck I wont have to touch java again.
but anyway.. the results: it took 42745 rolls to get enough stat points for 18's in everything but charisma, and a /98 strength modifier. not bad. kensai/mage here i come :)
Name:
Anonymous2008-08-15 16:02
>>9 3 years into a computer engineering degree … they're finally going to be teaching me C
Enjoy your degree. You deserve it.
Name:
Anonymous2008-08-15 16:03
3 years into a computer engineering degree … they're finally going to be teaching me C
Sorry, I forgot to BBCode.
Name:
Anonymous2008-08-15 16:15
>>10
That post is so un/prog/-like. Is there some hidden insult in it?
What the fuck. I'm in computer engineering and C was our very first language. VHDL (digital design) is also in a first semester course, and assembly in the second semester. Then it goes into matlab, some JAVA for the design class, etc.
Are you sure you didn't get tricked into a software eng. (aka FLAMING RETARD) degree?
Name:
Anonymous2008-08-15 20:37
DON'T HELP HIM
Name:
Anonymous2008-08-15 20:37
VHDL is fuckin gay. Seriously, what a bunch of fucking BOLLOCKS. I had to take a course where we used VHDL and all I learned was that VHDL is a piece of shite.
Why didnt those chavs at VHDL implement a DSL in The Algorithmic Language Scheme. It would have been way more extensible, and cause less headaches for REAL scientists, not those fake ass engineers that think they run the world.
>>30
The same thing that makes any new age bullshit so damn gay.
Name:
Anonymous2008-08-16 12:30
OP HERE:
why do people hate computer engineers :(
>>18
My courses are sort of screwed up because of transferring schools and the disparities between the order of the courses at either one. I've taken some courses like Circuits Analysis 2 and Engineering Statistics and other bullshit that most other beginning 3rd years haven't taken yet, but on the other hand as of now all I have experience with is java (and c# :D). It'll (presumably) work out in the end.
>>20
I just took VHDL and I agree with you that it's retarded. I can't imagine they use it at any of the places I'd like to eventually be employed, but they probably do and I'll probably be stuck using it just because it would piss me off.
PS: If I were to pick either software engineering or computer science to minor in, which should I choose? Or something else entirely?
Name:
Anonymous2008-08-16 12:32
>>32
Because they are people like you. Read >>1, you'll understand
Name:
Anonymous2008-08-16 13:01
>>32
Oh, for fuck's sake, haven't you been reading the thread? Stay the fuck away from Software Engineering. That sort of evil bullshit is the bane of software development.
Name:
Anonymous2008-08-16 18:36
>>8
Every time I see a title like that, all I can think is, "Yes, yes it is."
Name:
Anonymous2008-08-17 8:30
>>34 That sort of evil bullshit is the bone of software development.
o hi i fixed your post