Aqua-Soft Forums: Visual Basic Program Launcher - Aqua-Soft Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Visual Basic Program Launcher Rate Topic: -----

#1 User is offline   Phoshi Icon

  • Group: Member
  • Posts: 996
  • Joined: 03-April 08

Posted 27 November 2008 - 10:34 PM

I'm making a program launcher, similar to launchy, but infinitely more basic, in VB.

Yeah I know, VB.
The reason being, my IT techies are idiots, and when I took executor into school, they noticed and banned my account for "hacking". I tried to explain what it was, but no, I was "hacking". That'll teach me to try and work faster, eh.

So, to get round this, I'm making my own - it's a personal project, they can see the source, and my computing teacher has said he'll fight my case if they take offence.
Anyway, I've gotten reasonably far, it pops up on a keycombo, lets me launch stuff, and so, but I'm having a few errors:

1)Apps start minimised
2)Calling up the launcher (it uses windowstate=0 to unminimise) doesn't always give it focus. It's always on top, so I can just click, but it's a keyboard launcher ^_^;

Can anybody help, bearing in mind my school have simply mass-blocked downloads, so no APIs or anything :(
0

#2 User is offline   Phoshi Icon

  • Group: Member
  • Posts: 996
  • Joined: 03-April 08

Posted 01 December 2008 - 04:59 PM

ok **** it I'm using C#, still, any help?
0

#3 User is offline   matonga Icon

  • Group: Developers
  • Posts: 1,286
  • Joined: 04-September 06

Posted 02 December 2008 - 02:41 AM

1) What are you using to execute apps? (just paste the code as-is).

2) To give it the focus try something like Show( ), ShowWindow, etc...

Really can't help much, you should post something more detailed, with pieces of code, or the names of the functions you're calling.
0

#4 User is offline   Phoshi Icon

  • Group: Member
  • Posts: 996
  • Joined: 03-April 08

Posted 02 December 2008 - 04:04 PM

I've pretty much fixed it now, but just for future reference:

I was using the Shell(path) command to launch things, that was fixed by actually looking at the function, and realising it needed a vbNormalFocus after it, to make it normal. and focused. :D

To give focus I was using me.windowstate=0 (to unminimise), but that snippet has now expanded to include me.show and me.setfocus, as well as me.zorder. It works often, but sometimes fails for no apparent reason. In any case, it's coming along quite nicely, aulthough it doesn't actually index anything yet (I'm kinda stuck on that :)
0

#5 User is offline   CoderOmega Icon

  • Group: Member
  • Posts: 11
  • Joined: 12-December 08

Posted 13 December 2008 - 04:04 PM

Hi, I'm also working on an application launcher and I use .net3.5 c# wpf.
The reason I use wpf is for animation purposes, but the rest should be similar to what you are doing.

you seem to have solved your problem, but I'll show you the way I do because I use .net instead of importing a dll, and find it better to do this way whenever I can.
It also automatically give it focus.


System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = icon.target;
p.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(icon.target);
p.Start();

ps: icon.target is simply a string showing the path to the application to launch.
0

#6 User is offline   Phoshi Icon

  • Group: Member
  • Posts: 996
  • Joined: 03-April 08

Posted 13 December 2008 - 04:07 PM

Thanks, though I don't have .net :( (and stuck with VB ^_^

It's skinnable using magic pink as transparent, though I'd love alpha transparency later on :s

Great to see I'm not alone in what I'm doing, though ;)
0

#7 User is offline   CoderOmega Icon

  • Group: Member
  • Posts: 11
  • Joined: 12-December 08

Posted 13 December 2008 - 04:20 PM

oh, sorry I put it there since you said you were going the c# way a few post above.
but maybe there is a similar way to do it in vb too.

Here is a link to the first prototype I made using c# 2.0 :
http://www.youtube.c...h?v=b8pWmXdhOTo.

The problem was cpu use climbed up to 80% during the rotation so now I changed to using wpf and it went down to 6% cpu usage :)
I still have a long way before release though, because I still don't have menus or even a name for my application.
0

#8 User is offline   Phoshi Icon

  • Group: Member
  • Posts: 996
  • Joined: 03-April 08

Posted 13 December 2008 - 04:31 PM

Hehe, that looks really cool :)

I've gotten it to hide and show (I had a hackish way of doing it to do with focus loss, but now I've implemented layered window support, it's actually just 0% transparent and click through, with a cool little fade for coming in and out :3)

I'd love to do that stuff, but I've decided to ditch c# and learn c++, on the recommendation of god knows how many people <_<
0

#9 User is offline   CoderOmega Icon

  • Group: Member
  • Posts: 11
  • Joined: 12-December 08

Posted 13 December 2008 - 04:57 PM

c++ is more performant than c# so it's better to know it but I think there is one important part than those people either don't know or ommited to tell, c++ is not a lot more performant, I believe the biggest gain in speed comes from using openGL in an application and it's much more difficult to learn then.

That's why I went the wpf way, since wpf is an abstraction of directx(that's the reason of the big cpu improvement in my application).
And wpf is much easier to learn too. Also I read somewhere that when you make the installation package in .net 3.5, it automatically download the framework and directx for the user now.

I also wish to learn c++ and openGL one day but from what I heard the learning curve is quite difficult.
In the end it's your choice, if you don't want to suddently have a big amount of advance knowledge to learn I would suggest c# 3.5, but if you prefer multiplatform application and are ready to work hard for better result but those will show much later then go with c++.
0

#10 User is offline   Phoshi Icon

  • Group: Member
  • Posts: 996
  • Joined: 03-April 08

Posted 13 December 2008 - 05:02 PM

Yeah, if I actually had a project in mind, I'd go with c#, but I want to learn something hard - C++ fits the bill. Pointers are scary, but manageable, like any good horror film :3
0

#11 User is offline   CoderOmega Icon

  • Group: Member
  • Posts: 11
  • Joined: 12-December 08

Posted 13 December 2008 - 05:14 PM

don't forget openGL then, c++ alone wouldn't be that good.
And why not going the c way then. that should be difficult enough.:) :) :)
0

#12 User is offline   Phoshi Icon

  • Group: Member
  • Posts: 996
  • Joined: 03-April 08

Posted 13 December 2008 - 05:15 PM

eh, c++ just has higher public opinion. I've asked people if I should learn c# or c++, and they've said "wtf is c#?" so yeah, I figure "why not :D"
0

#13 User is offline   matonga Icon

  • Group: Developers
  • Posts: 1,286
  • Joined: 04-September 06

Posted 14 December 2008 - 11:20 AM

Phoshi;517271 said:

eh, c++ just has higher public opinion. I've asked people if I should learn c# or c++, and they've said "wtf is c#?" so yeah, I figure "why not :D"


Let's put some light on this:

C++ is faster. Among other stuff, it is faster because objects won't free themselves. So, if you have something like:

CMyClass * instance = new CMyClass ( ... );

You'll have to put this somewhere:

delete instance;

Yeah, sure you can also put this:

CMyClass instance = CMyClass( ... );

But it will be automatically freed as soon as the function ends (d'oh!).

C# instead automatically frees objects, so you don't need to bother about deleting them (and I'm sure you can't delete them manually BTW).

So, for long projects which don't require a lot of speed (i.e. anything else than videogames or a specific scientific app) coders will benefit more on C#.

Other than that, I dunno about the differences between C# and C++ (other than easier handling of pointers in C++).
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users