private void frmAntibot_Load(object sender, EventArgs e) { aPBox = new PBoxArray(this); aLabel = new LabelArray(this); for (int y = 1; y <= 3; y++) { for (int x = 1; x <= 3; x++) { int xs = 90, ys = 65; int aThis = ControlIntFromXY(x, y); aPBox.NewPBox(); aLabel.NewLabel(); abPanel.Controls.Add(aLabel[aThis]); abPanel.Controls.Add(aPBox[aThis]); aPBox[aThis].BringToFront(); aPBox[aThis].Size = new Size(xs, ys); aPBox[aThis].Location = new Point(((x * (xs + 6 + 16)) - (xs + 6 + 16)) + 8, ((y * (ys + 6 + 16)) - (ys + 6 + 16)) + 8); string stFName = ""; while (true) { stFName = "tmp/abtmp_" + RandomChars(8) + ".jpg"; if (!System.IO.File.Exists(stFName)) { break; } } System.IO.File.Copy("tmp/" + Program.sAbPrefix + aThis + ".jpg", stFName); //string stFName = "tmp/" + Program.sAbPrefix + aThis + ".jpg"; try { aPBox[aThis].BackgroundImage = (new Bitmap(stFName)) as Image; } catch { aPBox[aThis].BackColor = Color.FromArgb(255, 0, 0); } aPBox[aThis].BackgroundImageLayout = ImageLayout.Stretch; aLabel[aThis].Size = new Size(aPBox[aThis].Size.Width + 16, aPBox[aThis].Size.Height + 16); aLabel[aThis].Location = new Point(aPBox[aThis].Location.X - 8, aPBox[aThis].Location.Y - 8); aLabel[aThis].BackColor = Color.FromArgb(20, 75, 120); aLabel[aThis].Text = ""; } } /*cGo.Top = aLabel[8].Location.Y + aLabel[8].Height + 6; * cGo.Width = aLabel[8].Location.X - aLabel[0].Location.X + aLabel[8].Width; * lbHdr.Width = cGo.Width; * this.Size = new Size(cGo.Top + cGo.Height + 33, cGo.Left + cGo.Width + 26);*/ FormPos.SetWindowPos(this.Handle, -1, 0, 0, 0, 0, FormPos.SWP_NOMOVE + FormPos.SWP_NOSIZE + FormPos.SWP_SHOWWINDOW); FormPos.SetWindowPos(this.Handle, -2, 0, 0, 0, 0, FormPos.SWP_NOMOVE + FormPos.SWP_NOSIZE + FormPos.SWP_SHOWWINDOW); this.Show(); cGo.Focus(); Application.DoEvents(); FormPos.SetForegroundWindow(this.Handle); }
private void frmAntibot_FormClosed(object sender, FormClosedEventArgs e) { aLabel = null; aPBox = null; Program.bAbEnded = true; }