- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Noooooooooooooooooooooooooooooooooooo!
That's all I have to say about that!
Admin
Om my God! That is horrendous. I wonder what it would do on my system where the taskbar is at the top of the screen. Can't be good...
Admin
Let us get tied into (knots with) the UI.
I wonder if it occurred to him that there could be a better way. Considering what he did know, it ought to be a reasonable conclusion that there is probably a better way that is easy.
Sincerely,
Gene Wirchenko
Admin
I call shenanigans!
This can't really be true?!@?#?$
cry
-- W
Admin
Hey that sounds a lot like this:
http://blogs.msdn.com/oldnewthing/archive/2005/08/16/452141.aspx
(the story in the last paragraph)
Admin
Another quality piece of code from the VB community.
Admin
I have two rows in my task bar (you can open lots of windows)... Therefore in my case i'd guess that he'd miss my start button! oops... too bad it doesn't error with an "Aaaarrrrrgggghhh" msg
Admin
What happens when a user moves their taskbar to the right hand side of the screen?
I would suggest that this programmer make sweeps across the screen, examining 20x20 px squares looking for a portion of the word "Start". This would be a much more robust solution for locating the start menu than just assuming that Screen.Height / 15 - 10 will work.
Admin
Thankfully, "run" is the only thing in the Start menu that could possibly start with an "R"... [8-)]
Admin
<font size="2">Holy mother of Bob.
</font>
Admin
Anyone want to comment on what this does? is he assuming that the start menu height is 1/15th of the screen height, and that he can just subtract 10 to land in the middle? What if your screen is really big?
Admin
Better yet, what do you think happens when this guy wants to call another executable? I'll bet it goes something like this:
Admin
GET OUT!!!!
Admin
The other problem is that it's 'R' only on the english version on Windows. In my czech version it would be 'T'.
Admin
Wow,
If you can send me the executable for this "program", I would love to run it on my machine and watch this monstrosity in action. I never cease to be amazed how people are willing to spend the time and effort to do this kind of stuff and not give up until they get the darn thing working using their WTF solution.
I am much too lazy to get this kind of junk to work.
All I can say is good job!
Admin
hell yeah!
i'm reminded of old windows and record macro thinggy ... that caused me all kinds of problems
Admin
Ah, someone else who likes the taskbar at the top.
I have seen a number of programs, ah, not do well, when the taskbar is at the top of the screen. Is there a series of WTFs on assuming default setups?
Sincerely,
Gene Wirchenko
Admin
I once had a finger slip on one command and so typed "ruin" for "run".
Sincerely,
Gene Wirchenko
Admin
Since Windows NT, I believe, Windows has provided functions that
i. return the screen resolution (e.g. 1024x768)
ii. return a RECT of the available screen real estate minus the space taken up by the taskbar (e.g. 0, 0, 1024, 700 if your taskbar is on the bottom; 80, 0, 1024, 768 if your taskbar is on the left, etc.)
Far too often programs assume that the upper-left corner of the screen is (0,0), so taskbar positions that mess with that cause all sorts of havoc.
Admin
Yet another shining example of the typical quality of a Visual Basic developer's code.
Admin
My favorite part is that he uses sendkeys, but the idea of using sendkeys to send the "windows" key, which pops up the start menu! (Unless you have some wicked wild key remapping going on.)
Admin
I'm not sure if people are joking or not with some of the responses to this WTF. Their is no good way to do this using screen geometry. As a hack you might be able to send WINDOWS+R to duplicate the Start->Run monstrosity. However, the correct way to do this sort of thing in VB is probably with Shell() or CreateProcess() depending on whether or not you need to capture output, and if you need to wait for the process to exit before continuing. That's as of VB6, I haven't used VB.Net.
Admin
Alright, I had to look into this as I just couldn't figure out what Screen.Height / 15 - 10 was suppose to do. Screen.Height returns the height of the screen measured in twips. After trying to figure out how this factored in, I decided to take my screen height in twips (11520) and divide it by my screen height as measured by the control panel display applet in pixels (768) and ... you guessed it ... the answer if 15. The author was apparantly trying to convert from twips to screen coordinates. I really don't see how this calculation helps, however, as the API does not take the measurement in pixels, but in normalized absolute coordinates:
"dx and dy contain normalized absolute coordinates between 0 and 65,535. The event procedure maps these coordinates onto the display surface. Coordinate (0,0) maps onto the upper-left corner of the display surface, (65535,65535) maps onto the lower-right corner" (from the MSDN documentation).
Also, he passes in a value of 1 for the parameter dwData, which only applies for wheel data or X buttons. To quote the documentation:
"If dwFlags is not MOUSEEVENTF_WHEEL, MOUSEEVENTF_XDOWN, or MOUSEEVENTF_XUP, then dwData should be zero. "Admin
The CORRECT way is to use LoadLibrary, then GetProcAddress (to get the address of the function DllRegisterServer) and then use that address to call DllRegisterServer. I'm still surprised the dude didn't send WindowsKey+R for the run menu.
Admin
You obviously have no sense of adventure... Real Windows UI programmers don't rely on those flaky events like Button.Click(). If you are at all serious about quality programs, capture the Click event and use the Windows SendKey() method to hop the tab order on your form until you get to the right button. Then you can use SendKey() to send "Return"....
Admin
Yeah, I seem to remember alot of information on UI programming spread around at about the same time those pay to browse programs started popping up... coincidence?
Admin
I'm speechless.....uuuhhhmmmm. Oh, do chickens have large talons?
Admin
pay to browse meaning whatever company would pay you $.02 an hour to browse the web while their adds were on the bottom/top of your screen.
Admin
You would let that run on your machine?!! You, sir, are a brave man. I salute you.
Admin
Wow, that's really fascinating. Any other stories about typos you've made in the past? Please, enthrall and entertain us.
Sincerely,
Richard Nixon
Admin
Holy bleeping bleep. I read this thing religiously. I thought I'd seen it all, now this [:O]
Admin
Yet another nixon post contributing nothing while trying to make another poster feel bad. I wonder why. I know nixon sucked... but wtf lol.
Admin
Without more context, I can't really complain too much. I've seen lots of testing software that puts events on the event queue to simulate how a user would actually do something. Perhaps this was a test program for an install process?
Oh, who am I kidding. This is horrible.
Admin
Well, to be fair, the code comes from a bunch of kids trying to figure out programming, and the author is aware of how awful this way of registering a control is.
http://www.youngcoders.com/thread15404.html
It's still quite an achievement to come up with a solution this wrong though :)
Admin
The more I read on this site the more I am convinced that I should get out of the programming business. I simply don't want to be associated with people who do such things and call themself "programmers".
Used car salesman seems like a much more honest profession than programming to me now. Any job offers?
Admin
http://jobsearch.monster.com/jobsearch.asp?q=used+car+sales&fn=&lid=&re=104&cy=us
Admin
With a german Windows this will even shutdown the computer Oo
Admin
I think the true problem lies in our education system. People are graduating college with computer science degrees who don't C from C#, or Java from JavaScript. Yet, they still manage to pass all of their programming classes. I really think it has to do with some college requiring professors to pass X amount of students. If a professor gets 100 kids who can't program, and never learn how to, he still has to pass some or the administrators will thing he or she cannot teach programming. If it were up to me, I would have a very strict grading structure, and am sure that most of the time only one or two people would just barely pass a test in a group of 20. I have had to tutor CS students, and some of them just cannot be tought how to program. These people still manage to get their degrees. This is THE reason why I feel that CS degrees are completely useless.
Admin
i once typed 'teh' instead of 'the'.
Admin
I would like to see the routine he would create to output to a text file. Let's see, first move the mouse to the Notepad icon. Issue a double-click. Send keys for the entire contents of the text file being output. Move the mouse to the File menu. Click. Move to Exit. Click. Move to "Yes" button. Click "Yes" to save. And, of course, just hard-code the locations of all these things in absolute screen coordinates because everybody's computer is set up exactly like mine and I never move the Notepad window.
Admin
A classic "WTF" in the true spirit of what this site is all about.
Thanks, Alex !!
Admin
I'm inclined to agree. I recently went through a webdevelopment course (not the same as a CS degree I know), but while it taught programming in javascript and php, not once was it taught how to program. While I'm quite pleased to have recieved a diploma for the course, it's not something I'd place much value in when it comes to job interviews etc. Indeed if I ever find myself in the position of hiring people and I saw someone with the same degree I'd be more inclined to be harder on them, simply because of the level of crap I saw that was allowed to pass, including some code by one of the students which rivaled much of the WTF code I've seen posted here.
Admin
Arrgh but what about if 'auto-hide' is enabled ???
Admin
The obvious solution is to reset the user's taskbar location and other settings back to default settings when the program starts.
Admin
Hey that sounds a lot like this:
http://blogs.msdn.com/oldnewthing/archive/2005/08/16/452141.aspx
(the story in the last paragraph)</QUOTE>
Don't laugh. I have a driver install program that actually has to do that. It installs a device driver for some custom hardware on a 'headless' box (no keyboard, mouse, or monitor). In our case, there is no user to dismiss the message boxes for us.
Admin
That was going to be my question. Since you've asked it, with toungue firmly implanted in my cheek, I submit:
====================
Note: Be sure to programmatically turn up the speakers and unmute them before calling the ScreenShout API.
What?!? The ScreenShout API isn't one of the special 'hidden' APIs that Microsoft uses to maintain their Office marketshare dominance?
Admin
A long time ago I put my Start Menu at the top of the screen to test what it was like having it up amoungst the rest of the menus. I have kept it only partially for that reason because it has proved to be a stunningly accurate (and early/fast) software worthiness filter. It works like this; I install a piece of software and if it breaks or does something stupid because the Start Menu isn't where the code assumes it is (like the above piece of code does) I uninstall it immediately.
You'd be surprised how many previously reputable software companies have failed this simple test. No Adobe product will never be installed be me again - sadly, I haven't found a way to replace Flash yet, but then it hasn't been an Adobe product for as long either.
Admin
Correction: No Adobe product will EVER be installed be me again
Meanwhile, I've just learned that the "edit feature" appears not to be...
Admin
I used to know a guy who's last name was Teh. The fun he had using Word...
Admin
Heh... the funny thing about that is that he could've called Screen.twipsPerPixelY rather than hard-coding 15.
By entering 15 he's assuming that the user has the screen set at a particular resolution (probably 1024x768).
So, If you run 800x600 or 1280x1024 it's probably not even gonna hit the right spot anyway. :^)